Commit faba25c6 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

wineps: Remove gdi_physdev from print_ctx structure.

parent ab98b134
...@@ -110,7 +110,7 @@ static BOOL PSDRV_WriteImageMaskHeader(print_ctx *ctx, const BITMAPINFO *info, I ...@@ -110,7 +110,7 @@ static BOOL PSDRV_WriteImageMaskHeader(print_ctx *ctx, const BITMAPINFO *info, I
*/ */
if (!info->bmiHeader.biClrUsed) if (!info->bmiHeader.biClrUsed)
{ {
PSDRV_CreateColor( ctx, &foregnd, GetTextColor( ctx->dev.hdc ) ); PSDRV_CreateColor( ctx, &foregnd, GetTextColor( ctx->hdc ) );
bkgnd = ctx->bkColor; bkgnd = ctx->bkColor;
} }
else else
......
...@@ -36,7 +36,7 @@ HBRUSH CDECL PSDRV_SelectBrush( print_ctx *ctx, HBRUSH hbrush, const struct brus ...@@ -36,7 +36,7 @@ HBRUSH CDECL PSDRV_SelectBrush( print_ctx *ctx, HBRUSH hbrush, const struct brus
TRACE("hbrush = %p\n", hbrush); TRACE("hbrush = %p\n", hbrush);
if (hbrush == GetStockObject( DC_BRUSH )) if (hbrush == GetStockObject( DC_BRUSH ))
logbrush.lbColor = GetDCBrushColor( ctx->dev.hdc ); logbrush.lbColor = GetDCBrushColor( ctx->hdc );
switch(logbrush.lbStyle) { switch(logbrush.lbStyle) {
...@@ -71,7 +71,7 @@ HBRUSH CDECL PSDRV_SelectBrush( print_ctx *ctx, HBRUSH hbrush, const struct brus ...@@ -71,7 +71,7 @@ HBRUSH CDECL PSDRV_SelectBrush( print_ctx *ctx, HBRUSH hbrush, const struct brus
*/ */
COLORREF CDECL PSDRV_SetDCBrushColor( print_ctx *ctx, COLORREF color ) COLORREF CDECL PSDRV_SetDCBrushColor( print_ctx *ctx, COLORREF color )
{ {
if (GetCurrentObject( ctx->dev.hdc, OBJ_BRUSH ) == GetStockObject( DC_BRUSH )) if (GetCurrentObject( ctx->hdc, OBJ_BRUSH ) == GetStockObject( DC_BRUSH ))
{ {
PSDRV_CreateColor( ctx, &ctx->brush.color, color ); PSDRV_CreateColor( ctx, &ctx->brush.color, color );
ctx->brush.set = FALSE; ctx->brush.set = FALSE;
...@@ -90,7 +90,7 @@ static BOOL PSDRV_SetBrush( print_ctx *ctx ) ...@@ -90,7 +90,7 @@ static BOOL PSDRV_SetBrush( print_ctx *ctx )
LOGBRUSH logbrush; LOGBRUSH logbrush;
BOOL ret = TRUE; BOOL ret = TRUE;
if (!GetObjectA( GetCurrentObject(ctx->dev.hdc,OBJ_BRUSH), sizeof(logbrush), &logbrush )) if (!GetObjectA( GetCurrentObject(ctx->hdc,OBJ_BRUSH), sizeof(logbrush), &logbrush ))
{ {
ERR("Can't get BRUSHOBJ\n"); ERR("Can't get BRUSHOBJ\n");
return FALSE; return FALSE;
...@@ -155,7 +155,7 @@ BOOL PSDRV_Brush(print_ctx *ctx, BOOL EO) ...@@ -155,7 +155,7 @@ BOOL PSDRV_Brush(print_ctx *ctx, BOOL EO)
if(ctx->pathdepth) if(ctx->pathdepth)
return FALSE; return FALSE;
if (!GetObjectA( GetCurrentObject(ctx->dev.hdc,OBJ_BRUSH), sizeof(logbrush), &logbrush )) if (!GetObjectA( GetCurrentObject(ctx->hdc,OBJ_BRUSH), sizeof(logbrush), &logbrush ))
{ {
ERR("Can't get BRUSHOBJ\n"); ERR("Can't get BRUSHOBJ\n");
return FALSE; return FALSE;
......
...@@ -41,7 +41,7 @@ BOOL PSDRV_WriteSetBuiltinFont(print_ctx *ctx) ...@@ -41,7 +41,7 @@ BOOL PSDRV_WriteSetBuiltinFont(print_ctx *ctx)
struct font_info font_info; struct font_info font_info;
matrix size; matrix size;
ExtEscape(ctx->dev.hdc, PSDRV_GET_BUILTIN_FONT_INFO, 0, NULL, ExtEscape(ctx->hdc, PSDRV_GET_BUILTIN_FONT_INFO, 0, NULL,
sizeof(font_info), (char *)&font_info); sizeof(font_info), (char *)&font_info);
size.xx = font_info.size.cx; size.xx = font_info.size.cx;
size.yy = font_info.size.cy; size.yy = font_info.size.cy;
...@@ -57,7 +57,7 @@ BOOL PSDRV_WriteBuiltinGlyphShow(print_ctx *ctx, LPCWSTR str, INT count) ...@@ -57,7 +57,7 @@ BOOL PSDRV_WriteBuiltinGlyphShow(print_ctx *ctx, LPCWSTR str, INT count)
for (i = 0; i < count; ++i) for (i = 0; i < count; ++i)
{ {
ExtEscape(ctx->dev.hdc, PSDRV_GET_GLYPH_NAME, sizeof(str[i]), (const char *)&str[i], sizeof(name), name); ExtEscape(ctx->hdc, PSDRV_GET_GLYPH_NAME, sizeof(str[i]), (const char *)&str[i], sizeof(name), name);
PSDRV_WriteGlyphShow(ctx, name); PSDRV_WriteGlyphShow(ctx, name);
} }
......
...@@ -80,7 +80,7 @@ void PSDRV_SetClip( print_ctx *ctx ) ...@@ -80,7 +80,7 @@ void PSDRV_SetClip( print_ctx *ctx )
{ {
HRGN hrgn; HRGN hrgn;
TRACE("hdc=%p\n", ctx->dev.hdc); TRACE("hdc=%p\n", ctx->hdc);
if(ctx->pathdepth) { if(ctx->pathdepth) {
TRACE("inside a path, so not clipping\n"); TRACE("inside a path, so not clipping\n");
...@@ -88,7 +88,7 @@ void PSDRV_SetClip( print_ctx *ctx ) ...@@ -88,7 +88,7 @@ void PSDRV_SetClip( print_ctx *ctx )
} }
hrgn = CreateRectRgn(0, 0, 0, 0); hrgn = CreateRectRgn(0, 0, 0, 0);
if (GetRandomRgn(ctx->dev.hdc, hrgn, 3) == 1) /* clip && meta */ if (GetRandomRgn(ctx->hdc, hrgn, 3) == 1) /* clip && meta */
{ {
PSDRV_WriteGSave(ctx); PSDRV_WriteGSave(ctx);
PSDRV_AddClip( ctx, hrgn ); PSDRV_AddClip( ctx, hrgn );
...@@ -107,7 +107,7 @@ void PSDRV_ResetClip( print_ctx *ctx ) ...@@ -107,7 +107,7 @@ void PSDRV_ResetClip( print_ctx *ctx )
if (ctx->pathdepth) return; if (ctx->pathdepth) return;
hrgn = CreateRectRgn(0, 0, 0, 0); hrgn = CreateRectRgn(0, 0, 0, 0);
if (GetRandomRgn(ctx->dev.hdc, hrgn, 3) == 1) /* clip && meta */ if (GetRandomRgn(ctx->hdc, hrgn, 3) == 1) /* clip && meta */
PSDRV_WriteGRestore(ctx); PSDRV_WriteGRestore(ctx);
DeleteObject(hrgn); DeleteObject(hrgn);
} }
...@@ -57,7 +57,7 @@ static void get_download_name(print_ctx *ctx, LPOUTLINETEXTMETRICA potm, char ** ...@@ -57,7 +57,7 @@ static void get_download_name(print_ctx *ctx, LPOUTLINETEXTMETRICA potm, char **
char *p; char *p;
DWORD size; DWORD size;
size = GetFontData(ctx->dev.hdc, MS_MAKE_TAG('n','a','m','e'), 0, NULL, 0); size = GetFontData(ctx->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);
...@@ -75,7 +75,7 @@ static void get_download_name(print_ctx *ctx, LPOUTLINETEXTMETRICA potm, char ** ...@@ -75,7 +75,7 @@ static void get_download_name(print_ctx *ctx, LPOUTLINETEXTMETRICA potm, char **
USHORT offset; USHORT offset;
} *name_record; } *name_record;
GetFontData(ctx->dev.hdc, MS_MAKE_TAG('n','a','m','e'), 0, name, size); GetFontData(ctx->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 = (struct name_record *)(name + 6); name_record = (struct name_record *)(name + 6);
...@@ -266,7 +266,7 @@ BOOL PSDRV_WriteSetDownloadFont(print_ctx *ctx, BOOL vertical) ...@@ -266,7 +266,7 @@ BOOL PSDRV_WriteSetDownloadFont(print_ctx *ctx, BOOL vertical)
{ {
char *ps_name; char *ps_name;
LPOUTLINETEXTMETRICA potm; LPOUTLINETEXTMETRICA potm;
DWORD len = GetOutlineTextMetricsA(ctx->dev.hdc, 0, NULL); DWORD len = GetOutlineTextMetricsA(ctx->hdc, 0, NULL);
DOWNLOAD *pdl; DOWNLOAD *pdl;
LOGFONTW lf; LOGFONTW lf;
UINT ppem; UINT ppem;
...@@ -275,24 +275,24 @@ BOOL PSDRV_WriteSetDownloadFont(print_ctx *ctx, BOOL vertical) ...@@ -275,24 +275,24 @@ BOOL PSDRV_WriteSetDownloadFont(print_ctx *ctx, BOOL vertical)
assert(ctx->font.fontloc == Download); assert(ctx->font.fontloc == Download);
if (!GetObjectW( GetCurrentObject(ctx->dev.hdc, OBJ_FONT), sizeof(lf), &lf )) if (!GetObjectW( GetCurrentObject(ctx->hdc, OBJ_FONT), sizeof(lf), &lf ))
return FALSE; return FALSE;
potm = HeapAlloc(GetProcessHeap(), 0, len); potm = HeapAlloc(GetProcessHeap(), 0, len);
if (!potm) if (!potm)
return FALSE; return FALSE;
GetOutlineTextMetricsA(ctx->dev.hdc, len, potm); GetOutlineTextMetricsA(ctx->hdc, len, potm);
get_download_name(ctx, potm, &ps_name, vertical); get_download_name(ctx, potm, &ps_name, vertical);
ctx->font.fontinfo.Download = is_font_downloaded(ctx, ps_name); ctx->font.fontinfo.Download = is_font_downloaded(ctx, ps_name);
ppem = calc_ppem_for_height(ctx->dev.hdc, lf.lfHeight); ppem = calc_ppem_for_height(ctx->hdc, lf.lfHeight);
/* Retrieve the world -> device transform */ /* Retrieve the world -> device transform */
GetTransform(ctx->dev.hdc, 0x204, &xform); GetTransform(ctx->hdc, 0x204, &xform);
if(GetGraphicsMode(ctx->dev.hdc) == GM_COMPATIBLE) if(GetGraphicsMode(ctx->hdc) == GM_COMPATIBLE)
{ {
if (xform.eM22 < 0) ctx->font.escapement = -ctx->font.escapement; if (xform.eM22 < 0) ctx->font.escapement = -ctx->font.escapement;
xform.eM11 = xform.eM22 = fabs(xform.eM22); xform.eM11 = xform.eM22 = fabs(xform.eM22);
...@@ -306,7 +306,7 @@ BOOL PSDRV_WriteSetDownloadFont(print_ctx *ctx, BOOL vertical) ...@@ -306,7 +306,7 @@ BOOL PSDRV_WriteSetDownloadFont(print_ctx *ctx, BOOL vertical)
if(ctx->font.fontinfo.Download == NULL) { if(ctx->font.fontinfo.Download == NULL) {
RECT bbox; RECT bbox;
UINT emsize = get_bbox(ctx->dev.hdc, &bbox); UINT emsize = get_bbox(ctx->hdc, &bbox);
if (!emsize) { if (!emsize) {
HeapFree(GetProcessHeap(), 0, ps_name); HeapFree(GetProcessHeap(), 0, ps_name);
...@@ -335,7 +335,7 @@ BOOL PSDRV_WriteSetDownloadFont(print_ctx *ctx, BOOL vertical) ...@@ -335,7 +335,7 @@ BOOL PSDRV_WriteSetDownloadFont(print_ctx *ctx, BOOL vertical)
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(ctx->dev.hdc, 0, g_name); get_glyph_name(ctx->hdc, 0, g_name);
T42_download_glyph(ctx, pdl, 0, g_name); T42_download_glyph(ctx, pdl, 0, g_name);
} }
} }
...@@ -345,7 +345,7 @@ BOOL PSDRV_WriteSetDownloadFont(print_ctx *ctx, BOOL vertical) ...@@ -345,7 +345,7 @@ BOOL PSDRV_WriteSetDownloadFont(print_ctx *ctx, BOOL vertical)
escapement += 900; escapement += 900;
PSDRV_WriteSetFont(ctx, ps_name, ctx->font.size, escapement, PSDRV_WriteSetFont(ctx, ps_name, ctx->font.size, escapement,
is_fake_italic( ctx->dev.hdc )); is_fake_italic( ctx->hdc ));
HeapFree(GetProcessHeap(), 0, ps_name); HeapFree(GetProcessHeap(), 0, ps_name);
HeapFree(GetProcessHeap(), 0, potm); HeapFree(GetProcessHeap(), 0, potm);
...@@ -746,7 +746,7 @@ BOOL PSDRV_WriteDownloadGlyphShow(print_ctx *ctx, const WORD *glyphs, ...@@ -746,7 +746,7 @@ BOOL PSDRV_WriteDownloadGlyphShow(print_ctx *ctx, const WORD *glyphs,
switch(ctx->font.fontinfo.Download->type) { switch(ctx->font.fontinfo.Download->type) {
case Type42: case Type42:
for(i = 0; i < count; i++) { for(i = 0; i < count; i++) {
get_glyph_name(ctx->dev.hdc, glyphs[i], g_name); get_glyph_name(ctx->hdc, glyphs[i], g_name);
T42_download_glyph(ctx, ctx->font.fontinfo.Download, glyphs[i], g_name); T42_download_glyph(ctx, ctx->font.fontinfo.Download, glyphs[i], g_name);
PSDRV_WriteGlyphShow(ctx, g_name); PSDRV_WriteGlyphShow(ctx, g_name);
} }
...@@ -754,7 +754,7 @@ BOOL PSDRV_WriteDownloadGlyphShow(print_ctx *ctx, const WORD *glyphs, ...@@ -754,7 +754,7 @@ BOOL PSDRV_WriteDownloadGlyphShow(print_ctx *ctx, const WORD *glyphs,
case Type1: case Type1:
for(i = 0; i < count; i++) { for(i = 0; i < count; i++) {
get_glyph_name(ctx->dev.hdc, glyphs[i], g_name); get_glyph_name(ctx->hdc, glyphs[i], g_name);
T1_download_glyph(ctx, ctx->font.fontinfo.Download, glyphs[i], g_name); T1_download_glyph(ctx, ctx->font.fontinfo.Download, glyphs[i], g_name);
PSDRV_WriteGlyphShow(ctx, g_name); PSDRV_WriteGlyphShow(ctx, g_name);
} }
......
...@@ -55,7 +55,7 @@ INT CDECL PSDRV_ExtEscape( print_ctx *ctx, INT nEscape, INT cbInput, LPCVOID in_ ...@@ -55,7 +55,7 @@ INT CDECL PSDRV_ExtEscape( print_ctx *ctx, INT nEscape, INT cbInput, LPCVOID in_
INT cbOutput, LPVOID out_data ) INT cbOutput, LPVOID out_data )
{ {
TRACE("%p,%d,%d,%p,%d,%p\n", TRACE("%p,%d,%d,%p,%d,%p\n",
ctx->dev.hdc, nEscape, cbInput, in_data, cbOutput, out_data); ctx->hdc, nEscape, cbInput, in_data, cbOutput, out_data);
switch(nEscape) switch(nEscape)
{ {
...@@ -152,7 +152,7 @@ INT CDECL PSDRV_ExtEscape( print_ctx *ctx, INT nEscape, INT cbInput, LPCVOID in_ ...@@ -152,7 +152,7 @@ INT CDECL PSDRV_ExtEscape( print_ctx *ctx, INT nEscape, INT cbInput, LPCVOID in_
*/ */
INT CDECL PSDRV_StartPage( print_ctx *ctx ) INT CDECL PSDRV_StartPage( print_ctx *ctx )
{ {
TRACE("%p\n", ctx->dev.hdc); TRACE("%p\n", ctx->hdc);
if(!ctx->job.OutOfPage) { if(!ctx->job.OutOfPage) {
FIXME("Already started a page?\n"); FIXME("Already started a page?\n");
...@@ -173,7 +173,7 @@ INT CDECL PSDRV_StartPage( print_ctx *ctx ) ...@@ -173,7 +173,7 @@ INT CDECL PSDRV_StartPage( print_ctx *ctx )
*/ */
INT CDECL PSDRV_EndPage( print_ctx *ctx ) INT CDECL PSDRV_EndPage( print_ctx *ctx )
{ {
TRACE("%p\n", ctx->dev.hdc); TRACE("%p\n", ctx->hdc);
if(ctx->job.OutOfPage) { if(ctx->job.OutOfPage) {
FIXME("Already ended a page?\n"); FIXME("Already ended a page?\n");
......
...@@ -42,7 +42,7 @@ HFONT CDECL PSDRV_SelectFont( print_ctx *ctx, HFONT hfont, UINT *aa_flags ) ...@@ -42,7 +42,7 @@ HFONT CDECL PSDRV_SelectFont( print_ctx *ctx, HFONT hfont, UINT *aa_flags )
{ {
struct font_info font_info; struct font_info font_info;
if (ExtEscape(ctx->dev.hdc, PSDRV_GET_BUILTIN_FONT_INFO, 0, NULL, if (ExtEscape(ctx->hdc, PSDRV_GET_BUILTIN_FONT_INFO, 0, NULL,
sizeof(font_info), (char *)&font_info)) sizeof(font_info), (char *)&font_info))
{ {
ctx->font.fontloc = Builtin; ctx->font.fontloc = Builtin;
......
...@@ -44,7 +44,7 @@ INT PSDRV_XWStoDS( print_ctx *ctx, INT width ) ...@@ -44,7 +44,7 @@ INT PSDRV_XWStoDS( print_ctx *ctx, INT width )
pt[0].y = 0; pt[0].y = 0;
pt[1].x = width; pt[1].x = width;
pt[1].y = 0; pt[1].y = 0;
LPtoDP( ctx->dev.hdc, pt, 2 ); LPtoDP( ctx->hdc, pt, 2 );
return pt[1].x - pt[0].x; return pt[1].x - pt[0].x;
} }
...@@ -71,10 +71,10 @@ BOOL CDECL PSDRV_LineTo(print_ctx *ctx, INT x, INT y) ...@@ -71,10 +71,10 @@ BOOL CDECL PSDRV_LineTo(print_ctx *ctx, INT x, INT y)
TRACE("%d %d\n", x, y); TRACE("%d %d\n", x, y);
GetCurrentPositionEx( ctx->dev.hdc, pt ); GetCurrentPositionEx( ctx->hdc, pt );
pt[1].x = x; pt[1].x = x;
pt[1].y = y; pt[1].y = y;
LPtoDP( ctx->dev.hdc, pt, 2 ); LPtoDP( ctx->hdc, pt, 2 );
PSDRV_SetPen(ctx); PSDRV_SetPen(ctx);
...@@ -98,12 +98,12 @@ BOOL CDECL PSDRV_Rectangle( print_ctx *ctx, INT left, INT top, INT right, INT bo ...@@ -98,12 +98,12 @@ BOOL CDECL PSDRV_Rectangle( print_ctx *ctx, INT left, INT top, INT right, INT bo
TRACE("%d %d - %d %d\n", left, top, right, bottom); TRACE("%d %d - %d %d\n", left, top, right, bottom);
SetRect(&rect, left, top, right, bottom); SetRect(&rect, left, top, right, bottom);
LPtoDP( ctx->dev.hdc, (POINT *)&rect, 2 ); LPtoDP( ctx->hdc, (POINT *)&rect, 2 );
/* Windows does something truly hacky here. If we're in passthrough mode /* Windows does something truly hacky here. If we're in passthrough mode
and our rop is R2_NOP, then we output the string below. This is used in and our rop is R2_NOP, then we output the string below. This is used in
Office 2k when inserting eps files */ Office 2k when inserting eps files */
if (ctx->job.passthrough_state == passthrough_active && GetROP2(ctx->dev.hdc) == R2_NOP) if (ctx->job.passthrough_state == passthrough_active && GetROP2(ctx->hdc) == R2_NOP)
{ {
char buf[256]; char buf[256];
...@@ -135,7 +135,7 @@ BOOL CDECL PSDRV_RoundRect( print_ctx *ctx, INT left, INT top, INT right, ...@@ -135,7 +135,7 @@ BOOL CDECL PSDRV_RoundRect( print_ctx *ctx, INT left, INT top, INT right,
SetRect(&rect[0], left, top, right, bottom); SetRect(&rect[0], left, top, right, bottom);
SetRect(&rect[1], 0, 0, ell_width, ell_height); SetRect(&rect[1], 0, 0, ell_width, ell_height);
LPtoDP( ctx->dev.hdc, (POINT *)rect, 4 ); LPtoDP( ctx->hdc, (POINT *)rect, 4 );
left = rect[0].left; left = rect[0].left;
top = rect[0].top; top = rect[0].top;
...@@ -188,13 +188,13 @@ static BOOL PSDRV_DrawArc( print_ctx *ctx, INT left, INT top, ...@@ -188,13 +188,13 @@ static BOOL PSDRV_DrawArc( print_ctx *ctx, INT left, INT top,
POINT start, end; POINT start, end;
SetRect(&rect, left, top, right, bottom); SetRect(&rect, left, top, right, bottom);
LPtoDP( ctx->dev.hdc, (POINT *)&rect, 2 ); LPtoDP( ctx->hdc, (POINT *)&rect, 2 );
start.x = xstart; start.x = xstart;
start.y = ystart; start.y = ystart;
end.x = xend; end.x = xend;
end.y = yend; end.y = yend;
LPtoDP( ctx->dev.hdc, &start, 1 ); LPtoDP( ctx->hdc, &start, 1 );
LPtoDP( ctx->dev.hdc, &end, 1 ); LPtoDP( ctx->hdc, &end, 1 );
x = (rect.left + rect.right) / 2; x = (rect.left + rect.right) / 2;
y = (rect.top + rect.bottom) / 2; y = (rect.top + rect.bottom) / 2;
...@@ -223,7 +223,7 @@ static BOOL PSDRV_DrawArc( print_ctx *ctx, INT left, INT top, ...@@ -223,7 +223,7 @@ static BOOL PSDRV_DrawArc( print_ctx *ctx, INT left, INT top,
else else
PSDRV_WriteNewPath( ctx ); PSDRV_WriteNewPath( ctx );
if(GetArcDirection(ctx->dev.hdc) == AD_COUNTERCLOCKWISE) if(GetArcDirection(ctx->hdc) == AD_COUNTERCLOCKWISE)
PSDRV_WriteArc(ctx, x, y, w, h, start_angle, end_angle); PSDRV_WriteArc(ctx, x, y, w, h, start_angle, end_angle);
else else
PSDRV_WriteArc(ctx, x, y, w, h, end_angle, start_angle); PSDRV_WriteArc(ctx, x, y, w, h, end_angle, start_angle);
...@@ -278,7 +278,7 @@ BOOL CDECL PSDRV_Ellipse( print_ctx *ctx, INT left, INT top, INT right, INT bott ...@@ -278,7 +278,7 @@ BOOL CDECL PSDRV_Ellipse( print_ctx *ctx, INT left, INT top, INT right, INT bott
TRACE("%d %d - %d %d\n", left, top, right, bottom); TRACE("%d %d - %d %d\n", left, top, right, bottom);
SetRect(&rect, left, top, right, bottom); SetRect(&rect, left, top, right, bottom);
LPtoDP( ctx->dev.hdc, (POINT *)&rect, 2 ); LPtoDP( ctx->hdc, (POINT *)&rect, 2 );
x = (rect.left + rect.right) / 2; x = (rect.left + rect.right) / 2;
y = (rect.top + rect.bottom) / 2; y = (rect.top + rect.bottom) / 2;
...@@ -312,7 +312,7 @@ BOOL CDECL PSDRV_PolyPolyline( print_ctx *ctx, const POINT* pts, const DWORD* co ...@@ -312,7 +312,7 @@ BOOL CDECL PSDRV_PolyPolyline( print_ctx *ctx, const POINT* pts, const DWORD* co
for (polyline = total = 0; polyline < polylines; polyline++) total += counts[polyline]; for (polyline = total = 0; polyline < polylines; polyline++) total += counts[polyline];
if (!(dev_pts = HeapAlloc( GetProcessHeap(), 0, total * sizeof(*dev_pts) ))) return FALSE; if (!(dev_pts = HeapAlloc( GetProcessHeap(), 0, total * sizeof(*dev_pts) ))) return FALSE;
memcpy( dev_pts, pts, total * sizeof(*dev_pts) ); memcpy( dev_pts, pts, total * sizeof(*dev_pts) );
LPtoDP( ctx->dev.hdc, dev_pts, total ); LPtoDP( ctx->hdc, dev_pts, total );
pt = dev_pts; pt = dev_pts;
...@@ -348,7 +348,7 @@ BOOL CDECL PSDRV_PolyPolygon( print_ctx *ctx, const POINT* pts, const INT* count ...@@ -348,7 +348,7 @@ BOOL CDECL PSDRV_PolyPolygon( print_ctx *ctx, const POINT* pts, const INT* count
for (polygon = total = 0; polygon < polygons; polygon++) total += counts[polygon]; for (polygon = total = 0; polygon < polygons; polygon++) total += counts[polygon];
if (!(dev_pts = HeapAlloc( GetProcessHeap(), 0, total * sizeof(*dev_pts) ))) return FALSE; if (!(dev_pts = HeapAlloc( GetProcessHeap(), 0, total * sizeof(*dev_pts) ))) return FALSE;
memcpy( dev_pts, pts, total * sizeof(*dev_pts) ); memcpy( dev_pts, pts, total * sizeof(*dev_pts) );
LPtoDP( ctx->dev.hdc, dev_pts, total ); LPtoDP( ctx->hdc, dev_pts, total );
pt = dev_pts; pt = dev_pts;
...@@ -365,7 +365,7 @@ BOOL CDECL PSDRV_PolyPolygon( print_ctx *ctx, const POINT* pts, const INT* count ...@@ -365,7 +365,7 @@ BOOL CDECL PSDRV_PolyPolygon( print_ctx *ctx, const POINT* pts, const INT* count
} }
HeapFree( GetProcessHeap(), 0, dev_pts ); HeapFree( GetProcessHeap(), 0, dev_pts );
if(GetPolyFillMode( ctx->dev.hdc ) == ALTERNATE) if(GetPolyFillMode( ctx->hdc ) == ALTERNATE)
PSDRV_Brush(ctx, 1); PSDRV_Brush(ctx, 1);
else /* WINDING */ else /* WINDING */
PSDRV_Brush(ctx, 0); PSDRV_Brush(ctx, 0);
...@@ -383,7 +383,7 @@ static BOOL poly_bezier( print_ctx *ctx, const POINT *pt0, const POINT *pts, DWO ...@@ -383,7 +383,7 @@ static BOOL poly_bezier( print_ctx *ctx, const POINT *pt0, const POINT *pts, DWO
TRACE( "\n" ); TRACE( "\n" );
dev_pts[0] = *pt0; dev_pts[0] = *pt0;
LPtoDP( ctx->dev.hdc, dev_pts, 1 ); LPtoDP( ctx->hdc, dev_pts, 1 );
PSDRV_WriteSpool( ctx, "%PolyBezier\n", 12 ); PSDRV_WriteSpool( ctx, "%PolyBezier\n", 12 );
PSDRV_SetPen( ctx ); PSDRV_SetPen( ctx );
...@@ -392,7 +392,7 @@ static BOOL poly_bezier( print_ctx *ctx, const POINT *pt0, const POINT *pts, DWO ...@@ -392,7 +392,7 @@ static BOOL poly_bezier( print_ctx *ctx, const POINT *pt0, const POINT *pts, DWO
for (i = 0; i < count; i += 3) for (i = 0; i < count; i += 3)
{ {
memcpy( dev_pts, pts, sizeof(dev_pts) ); memcpy( dev_pts, pts, sizeof(dev_pts) );
LPtoDP( ctx->dev.hdc, dev_pts, 3 ); LPtoDP( ctx->hdc, dev_pts, 3 );
PSDRV_WriteCurveTo( ctx, dev_pts ); PSDRV_WriteCurveTo( ctx, dev_pts );
} }
PSDRV_DrawLine(ctx); PSDRV_DrawLine(ctx);
...@@ -416,7 +416,7 @@ BOOL CDECL PSDRV_PolyBezierTo( print_ctx *ctx, const POINT *pts, DWORD count ) ...@@ -416,7 +416,7 @@ BOOL CDECL PSDRV_PolyBezierTo( print_ctx *ctx, const POINT *pts, DWORD count )
{ {
POINT pt0; POINT pt0;
GetCurrentPositionEx( ctx->dev.hdc, &pt0 ); GetCurrentPositionEx( ctx->hdc, &pt0 );
return poly_bezier( ctx, &pt0, pts, count ); return poly_bezier( ctx, &pt0, pts, count );
} }
...@@ -431,7 +431,7 @@ COLORREF CDECL PSDRV_SetPixel( print_ctx *ctx, INT x, INT y, COLORREF color ) ...@@ -431,7 +431,7 @@ COLORREF CDECL PSDRV_SetPixel( print_ctx *ctx, INT x, INT y, COLORREF color )
pt.x = x; pt.x = x;
pt.y = y; pt.y = y;
LPtoDP( ctx->dev.hdc, &pt, 1 ); LPtoDP( ctx->hdc, &pt, 1 );
PSDRV_SetClip(ctx); PSDRV_SetClip(ctx);
/* we bracket the setcolor in gsave/grestore so that we don't trash /* we bracket the setcolor in gsave/grestore so that we don't trash
...@@ -455,7 +455,7 @@ BOOL CDECL PSDRV_PaintRgn( print_ctx *ctx, HRGN hrgn ) ...@@ -455,7 +455,7 @@ BOOL CDECL PSDRV_PaintRgn( print_ctx *ctx, HRGN hrgn )
RECT *pRect; RECT *pRect;
DWORD size, i; DWORD size, i;
TRACE("hdc=%p\n", ctx->dev.hdc); TRACE("hdc=%p\n", ctx->hdc);
size = GetRegionData(hrgn, 0, NULL); size = GetRegionData(hrgn, 0, NULL);
rgndata = HeapAlloc( GetProcessHeap(), 0, size ); rgndata = HeapAlloc( GetProcessHeap(), 0, size );
...@@ -468,7 +468,7 @@ BOOL CDECL PSDRV_PaintRgn( print_ctx *ctx, HRGN hrgn ) ...@@ -468,7 +468,7 @@ BOOL CDECL PSDRV_PaintRgn( print_ctx *ctx, HRGN hrgn )
if (rgndata->rdh.nCount == 0) if (rgndata->rdh.nCount == 0)
goto end; goto end;
LPtoDP(ctx->dev.hdc, (POINT*)rgndata->Buffer, rgndata->rdh.nCount * 2); LPtoDP(ctx->hdc, (POINT*)rgndata->Buffer, rgndata->rdh.nCount * 2);
PSDRV_SetClip(ctx); PSDRV_SetClip(ctx);
for(i = 0, pRect = (RECT*)rgndata->Buffer; i < rgndata->rdh.nCount; i++, pRect++) for(i = 0, pRect = (RECT*)rgndata->Buffer; i < rgndata->rdh.nCount; i++, pRect++)
...@@ -487,19 +487,19 @@ static BOOL paint_path( print_ctx *ctx, BOOL stroke, BOOL fill ) ...@@ -487,19 +487,19 @@ static BOOL paint_path( print_ctx *ctx, BOOL stroke, BOOL fill )
{ {
POINT *points; POINT *points;
BYTE *types; BYTE *types;
int i, size = GetPath( ctx->dev.hdc, NULL, NULL, 0 ); int i, size = GetPath( ctx->hdc, NULL, NULL, 0 );
if (size == -1) return FALSE; if (size == -1) return FALSE;
if (!size) if (!size)
{ {
AbortPath( ctx->dev.hdc ); AbortPath( ctx->hdc );
return TRUE; return TRUE;
} }
points = HeapAlloc( GetProcessHeap(), 0, size * sizeof(*points) ); points = HeapAlloc( GetProcessHeap(), 0, size * sizeof(*points) );
types = HeapAlloc( GetProcessHeap(), 0, size * sizeof(*types) ); types = HeapAlloc( GetProcessHeap(), 0, size * sizeof(*types) );
if (!points || !types) goto done; if (!points || !types) goto done;
if (GetPath( ctx->dev.hdc, points, types, size ) == -1) goto done; if (GetPath( ctx->hdc, points, types, size ) == -1) goto done;
LPtoDP( ctx->dev.hdc, points, size ); LPtoDP( ctx->hdc, points, size );
if (stroke) PSDRV_SetPen(ctx); if (stroke) PSDRV_SetPen(ctx);
PSDRV_SetClip(ctx); PSDRV_SetClip(ctx);
...@@ -523,11 +523,11 @@ static BOOL paint_path( print_ctx *ctx, BOOL stroke, BOOL fill ) ...@@ -523,11 +523,11 @@ static BOOL paint_path( print_ctx *ctx, BOOL stroke, BOOL fill )
break; break;
} }
} }
if (fill) PSDRV_Brush( ctx, GetPolyFillMode(ctx->dev.hdc) == ALTERNATE ); if (fill) PSDRV_Brush( ctx, GetPolyFillMode(ctx->hdc) == ALTERNATE );
if (stroke) PSDRV_DrawLine(ctx); if (stroke) PSDRV_DrawLine(ctx);
else PSDRV_WriteNewPath(ctx); else PSDRV_WriteNewPath(ctx);
PSDRV_ResetClip(ctx); PSDRV_ResetClip(ctx);
AbortPath( ctx->dev.hdc ); AbortPath( ctx->hdc );
done: done:
HeapFree( GetProcessHeap(), 0, points ); HeapFree( GetProcessHeap(), 0, points );
......
...@@ -372,7 +372,7 @@ print_ctx *create_print_ctx( HDC hdc, const WCHAR *device, ...@@ -372,7 +372,7 @@ print_ctx *create_print_ctx( HDC hdc, const WCHAR *device,
} }
PSDRV_UpdateDevCaps( ctx ); PSDRV_UpdateDevCaps( ctx );
ctx->dev.hdc = hdc; ctx->hdc = hdc;
SelectObject( hdc, GetStockObject( DEVICE_DEFAULT_FONT )); SelectObject( hdc, GetStockObject( DEVICE_DEFAULT_FONT ));
return ctx; return ctx;
} }
......
...@@ -68,7 +68,7 @@ HPEN CDECL PSDRV_SelectPen( print_ctx *ctx, HPEN hpen, const struct brush_patter ...@@ -68,7 +68,7 @@ HPEN CDECL PSDRV_SelectPen( print_ctx *ctx, HPEN hpen, const struct brush_patter
if(ctx->pen.width < 0) ctx->pen.width = -ctx->pen.width; if(ctx->pen.width < 0) ctx->pen.width = -ctx->pen.width;
} }
if (hpen == GetStockObject( DC_PEN )) if (hpen == GetStockObject( DC_PEN ))
logpen.lopnColor = GetDCPenColor( ctx->dev.hdc ); logpen.lopnColor = GetDCPenColor( ctx->hdc );
switch (logpen.lopnStyle & PS_JOIN_MASK) switch (logpen.lopnStyle & PS_JOIN_MASK)
{ {
...@@ -142,7 +142,7 @@ HPEN CDECL PSDRV_SelectPen( print_ctx *ctx, HPEN hpen, const struct brush_patter ...@@ -142,7 +142,7 @@ HPEN CDECL PSDRV_SelectPen( print_ctx *ctx, HPEN hpen, const struct brush_patter
*/ */
COLORREF CDECL PSDRV_SetDCPenColor( print_ctx *ctx, COLORREF color ) COLORREF CDECL PSDRV_SetDCPenColor( print_ctx *ctx, COLORREF color )
{ {
if (GetCurrentObject( ctx->dev.hdc, OBJ_PEN ) == GetStockObject( DC_PEN )) if (GetCurrentObject( ctx->hdc, OBJ_PEN ) == GetStockObject( DC_PEN ))
PSDRV_CreateColor( ctx, &ctx->pen.color, color ); PSDRV_CreateColor( ctx, &ctx->pen.color, color );
return color; return color;
} }
......
...@@ -355,13 +355,13 @@ static int stretch_blt(print_ctx *ctx, const EMRSTRETCHBLT *blt, ...@@ -355,13 +355,13 @@ static int stretch_blt(print_ctx *ctx, const EMRSTRETCHBLT *blt,
dst.log_y = blt->yDest; dst.log_y = blt->yDest;
dst.log_width = blt->cxDest; dst.log_width = blt->cxDest;
dst.log_height = blt->cyDest; dst.log_height = blt->cyDest;
dst.layout = GetLayout(ctx->dev.hdc); dst.layout = GetLayout(ctx->hdc);
if (blt->dwRop & NOMIRRORBITMAP) if (blt->dwRop & NOMIRRORBITMAP)
dst.layout |= LAYOUT_BITMAPORIENTATIONPRESERVED; dst.layout |= LAYOUT_BITMAPORIENTATIONPRESERVED;
if (!blt->cbBmiSrc) if (!blt->cbBmiSrc)
{ {
get_vis_rectangles(ctx->dev.hdc, &dst, NULL, 0, 0, NULL); get_vis_rectangles(ctx->hdc, &dst, NULL, 0, 0, NULL);
return PSDRV_PatBlt(ctx, &dst, blt->dwRop); return PSDRV_PatBlt(ctx, &dst, blt->dwRop);
} }
...@@ -371,7 +371,7 @@ static int stretch_blt(print_ctx *ctx, const EMRSTRETCHBLT *blt, ...@@ -371,7 +371,7 @@ static int stretch_blt(print_ctx *ctx, const EMRSTRETCHBLT *blt,
src.log_height = blt->cySrc; src.log_height = blt->cySrc;
src.layout = 0; src.layout = 0;
get_vis_rectangles(ctx->dev.hdc, &dst, &blt->xformSrc, get_vis_rectangles(ctx->hdc, &dst, &blt->xformSrc,
bi->bmiHeader.biWidth, abs(bi->bmiHeader.biHeight), &src); bi->bmiHeader.biWidth, abs(bi->bmiHeader.biHeight), &src);
memcpy(dst_info, bi, blt->cbBmiSrc); memcpy(dst_info, bi, blt->cbBmiSrc);
...@@ -582,10 +582,10 @@ static int mask_blt(print_ctx *ctx, const EMRMASKBLT *p, const BITMAPINFO *src_b ...@@ -582,10 +582,10 @@ static int mask_blt(print_ctx *ctx, const EMRMASKBLT *p, const BITMAPINFO *src_b
old_bmp_src = SelectObject(hdc_src, bmp_src); old_bmp_src = SelectObject(hdc_src, bmp_src);
bmp1 = CreateBitmap(mask_bi->bmiHeader.biWidth, mask_bi->bmiHeader.biHeight, 1, 1, NULL); bmp1 = CreateBitmap(mask_bi->bmiHeader.biWidth, mask_bi->bmiHeader.biHeight, 1, 1, NULL);
SetDIBits(ctx->dev.hdc, bmp1, 0, mask_bi->bmiHeader.biHeight, mask_bits, mask_bi, p->iUsageMask); SetDIBits(ctx->hdc, bmp1, 0, mask_bi->bmiHeader.biHeight, mask_bits, mask_bi, p->iUsageMask);
brush_mask = CreatePatternBrush(bmp1); brush_mask = CreatePatternBrush(bmp1);
DeleteObject(bmp1); DeleteObject(bmp1);
brush_dest = SelectObject(ctx->dev.hdc, GetStockObject(NULL_BRUSH)); brush_dest = SelectObject(ctx->hdc, GetStockObject(NULL_BRUSH));
/* make bitmap */ /* make bitmap */
hdc1 = CreateCompatibleDC(NULL); hdc1 = CreateCompatibleDC(NULL);
...@@ -642,7 +642,7 @@ static int mask_blt(print_ctx *ctx, const EMRMASKBLT *p, const BITMAPINFO *src_b ...@@ -642,7 +642,7 @@ static int mask_blt(print_ctx *ctx, const EMRMASKBLT *p, const BITMAPINFO *src_b
stretch_blt(ctx, &blt, bmp2_info, bits); stretch_blt(ctx, &blt, bmp2_info, bits);
/* restore all objects */ /* restore all objects */
SelectObject(ctx->dev.hdc, brush_dest); SelectObject(ctx->hdc, brush_dest);
SelectObject(hdc1, old_bmp1); SelectObject(hdc1, old_bmp1);
SelectObject(hdc2, old_bmp2); SelectObject(hdc2, old_bmp2);
SelectObject(hdc_src, old_bmp_src); SelectObject(hdc_src, old_bmp_src);
...@@ -723,8 +723,8 @@ static int plg_blt(print_ctx *ctx, const EMRPLGBLT *p) ...@@ -723,8 +723,8 @@ static int plg_blt(print_ctx *ctx, const EMRPLGBLT *p)
combine_transform(&xf, &xf, &p->xformSrc); combine_transform(&xf, &xf, &p->xformSrc);
GetTransform(ctx->dev.hdc, 0x203, &xform_dest); GetTransform(ctx->hdc, 0x203, &xform_dest);
SetWorldTransform(ctx->dev.hdc, &xf); SetWorldTransform(ctx->hdc, &xf);
/* now destination and source DCs use same coords */ /* now destination and source DCs use same coords */
maskblt.rclBounds = p->rclBounds; maskblt.rclBounds = p->rclBounds;
maskblt.xDest = p->xSrc; maskblt.xDest = p->xSrc;
...@@ -753,7 +753,7 @@ static int plg_blt(print_ctx *ctx, const EMRPLGBLT *p) ...@@ -753,7 +753,7 @@ static int plg_blt(print_ctx *ctx, const EMRPLGBLT *p)
mask_bi = (const BITMAPINFO *)((BYTE *)p + p->offBmiMask); mask_bi = (const BITMAPINFO *)((BYTE *)p + p->offBmiMask);
mask_bits = (BYTE *)p + p->offBitsMask; mask_bits = (BYTE *)p + p->offBitsMask;
mask_blt(ctx, &maskblt, src_bi, src_bits, mask_bi, mask_bits); mask_blt(ctx, &maskblt, src_bi, src_bits, mask_bi, mask_bits);
SetWorldTransform(ctx->dev.hdc, &xform_dest); SetWorldTransform(ctx->hdc, &xform_dest);
return TRUE; return TRUE;
} }
...@@ -796,7 +796,7 @@ static int set_di_bits_to_device(print_ctx *ctx, const EMRSETDIBITSTODEVICE *p) ...@@ -796,7 +796,7 @@ static int set_di_bits_to_device(print_ctx *ctx, const EMRSETDIBITSTODEVICE *p)
bi->bmiHeader.biClrUsed = 1 << info->bmiHeader.biBitCount; bi->bmiHeader.biClrUsed = 1 << info->bmiHeader.biBitCount;
bi->bmiHeader.biClrImportant = bi->bmiHeader.biClrUsed; bi->bmiHeader.biClrImportant = bi->bmiHeader.biClrUsed;
hpal = GetCurrentObject(ctx->dev.hdc, OBJ_PAL); hpal = GetCurrentObject(ctx->hdc, OBJ_PAL);
size = GetPaletteEntries(hpal, 0, bi->bmiHeader.biClrUsed, pal); size = GetPaletteEntries(hpal, 0, bi->bmiHeader.biClrUsed, pal);
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
{ {
...@@ -810,14 +810,14 @@ static int set_di_bits_to_device(print_ctx *ctx, const EMRSETDIBITSTODEVICE *p) ...@@ -810,14 +810,14 @@ static int set_di_bits_to_device(print_ctx *ctx, const EMRSETDIBITSTODEVICE *p)
bi->bmiHeader.biBitCount = 24; bi->bmiHeader.biBitCount = 24;
} }
bi->bmiHeader.biCompression = BI_RGB; bi->bmiHeader.biCompression = BI_RGB;
bitmap = CreateDIBSection(ctx->dev.hdc, bi, DIB_RGB_COLORS, (void **)&bits, NULL, 0); bitmap = CreateDIBSection(ctx->hdc, bi, DIB_RGB_COLORS, (void **)&bits, NULL, 0);
if (!bitmap) if (!bitmap)
return 1; return 1;
old_bitmap = SelectObject(ctx->dev.hdc, bitmap); old_bitmap = SelectObject(ctx->hdc, bitmap);
ret = SetDIBitsToDevice(ctx->dev.hdc, 0, 0, width, height, p->xSrc, p->ySrc, ret = SetDIBitsToDevice(ctx->hdc, 0, 0, width, height, p->xSrc, p->ySrc,
p->iStartScan, p->cScans, (const BYTE*)p + p->offBitsSrc, info, p->iUsageSrc); p->iStartScan, p->cScans, (const BYTE*)p + p->offBitsSrc, info, p->iUsageSrc);
SelectObject(ctx->dev.hdc, old_bitmap); SelectObject(ctx->hdc, old_bitmap);
if (ret) if (ret)
{ {
EMRSTRETCHBLT blt; EMRSTRETCHBLT blt;
...@@ -860,7 +860,7 @@ static int stretch_di_bits(print_ctx *ctx, const EMRSTRETCHDIBITS *p) ...@@ -860,7 +860,7 @@ static int stretch_di_bits(print_ctx *ctx, const EMRSTRETCHDIBITS *p)
HPALETTE hpal; HPALETTE hpal;
UINT i, size; UINT i, size;
hpal = GetCurrentObject(ctx->dev.hdc, OBJ_PAL); hpal = GetCurrentObject(ctx->hdc, OBJ_PAL);
size = GetPaletteEntries(hpal, 0, 1 << bi->bmiHeader.biBitCount, pal); size = GetPaletteEntries(hpal, 0, 1 << bi->bmiHeader.biBitCount, pal);
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
{ {
...@@ -914,7 +914,7 @@ static int poly_draw(print_ctx *ctx, const POINT *points, const BYTE *types, DWO ...@@ -914,7 +914,7 @@ static int poly_draw(print_ctx *ctx, const POINT *points, const BYTE *types, DWO
} }
} }
GetCurrentPositionEx(ctx->dev.hdc, &cur); GetCurrentPositionEx(ctx->hdc, &cur);
first = cur; first = cur;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
...@@ -980,7 +980,7 @@ static BOOL gradient_fill(print_ctx *ctx, const TRIVERTEX *vert_array, DWORD nve ...@@ -980,7 +980,7 @@ static BOOL gradient_fill(print_ctx *ctx, const TRIVERTEX *vert_array, DWORD nve
if (!(pts = malloc(nvert * sizeof(*pts)))) return FALSE; if (!(pts = malloc(nvert * sizeof(*pts)))) return FALSE;
memcpy(pts, vert_array, sizeof(*pts) * nvert); memcpy(pts, vert_array, sizeof(*pts) * nvert);
for (i = 0; i < nvert; i++) for (i = 0; i < nvert; i++)
LPtoDP(ctx->dev.hdc, (POINT *)&pts[i], 1); LPtoDP(ctx->hdc, (POINT *)&pts[i], 1);
/* compute bounding rect of all the rectangles/triangles */ /* compute bounding rect of all the rectangles/triangles */
reset_bounds(&dst.visrect); reset_bounds(&dst.visrect);
...@@ -997,7 +997,7 @@ static BOOL gradient_fill(print_ctx *ctx, const TRIVERTEX *vert_array, DWORD nve ...@@ -997,7 +997,7 @@ static BOOL gradient_fill(print_ctx *ctx, const TRIVERTEX *vert_array, DWORD nve
dst.y = dst.visrect.top; dst.y = dst.visrect.top;
dst.width = dst.visrect.right - dst.visrect.left; dst.width = dst.visrect.right - dst.visrect.left;
dst.height = dst.visrect.bottom - dst.visrect.top; dst.height = dst.visrect.bottom - dst.visrect.top;
clip_visrect(ctx->dev.hdc, &dst.visrect, &dst.visrect); clip_visrect(ctx->hdc, &dst.visrect, &dst.visrect);
info->bmiHeader.biSize = sizeof(info->bmiHeader); info->bmiHeader.biSize = sizeof(info->bmiHeader);
info->bmiHeader.biPlanes = 1; info->bmiHeader.biPlanes = 1;
...@@ -1730,7 +1730,7 @@ static BOOL ext_text_out(struct pp_data *data, HANDLETABLE *htable, ...@@ -1730,7 +1730,7 @@ static BOOL ext_text_out(struct pp_data *data, HANDLETABLE *htable,
int handle_count, INT x, INT y, UINT flags, const RECT *rect, int handle_count, INT x, INT y, UINT flags, const RECT *rect,
const WCHAR *str, UINT count, const INT *dx) const WCHAR *str, UINT count, const INT *dx)
{ {
HDC hdc = data->ctx->dev.hdc; HDC hdc = data->ctx->hdc;
BOOL ret = FALSE; BOOL ret = FALSE;
UINT align; UINT align;
DWORD layout; DWORD layout;
...@@ -2097,7 +2097,7 @@ static BOOL fill_rgn(struct pp_data *data, HANDLETABLE *htable, int handle_count ...@@ -2097,7 +2097,7 @@ static BOOL fill_rgn(struct pp_data *data, HANDLETABLE *htable, int handle_count
hbrush = get_object_handle(data, htable, brush, &pattern); hbrush = get_object_handle(data, htable, brush, &pattern);
PSDRV_SelectBrush(data->ctx, hbrush, pattern); PSDRV_SelectBrush(data->ctx, hbrush, pattern);
ret = PSDRV_PaintRgn(data->ctx, rgn); ret = PSDRV_PaintRgn(data->ctx, rgn);
select_hbrush(data, htable, handle_count, GetCurrentObject(data->ctx->dev.hdc, OBJ_BRUSH)); select_hbrush(data, htable, handle_count, GetCurrentObject(data->ctx->hdc, OBJ_BRUSH));
PSDRV_SelectBrush(data->ctx, hbrush, pattern); PSDRV_SelectBrush(data->ctx, hbrush, pattern);
return ret; return ret;
} }
...@@ -2146,7 +2146,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2146,7 +2146,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
struct pp_data *data = (struct pp_data *)arg; struct pp_data *data = (struct pp_data *)arg;
if (data->path && is_path_record(rec->iType)) if (data->path && is_path_record(rec->iType))
return PlayEnhMetaFileRecord(data->ctx->dev.hdc, htable, rec, handle_count); return PlayEnhMetaFileRecord(data->ctx->hdc, htable, rec, handle_count);
switch (rec->iType) switch (rec->iType)
{ {
...@@ -2182,7 +2182,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2182,7 +2182,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
const EMRPOLYBEZIERTO *p = (const EMRPOLYBEZIERTO *)rec; const EMRPOLYBEZIERTO *p = (const EMRPOLYBEZIERTO *)rec;
return PSDRV_PolyBezierTo(data->ctx, (const POINT *)p->aptl, p->cptl) && return PSDRV_PolyBezierTo(data->ctx, (const POINT *)p->aptl, p->cptl) &&
MoveToEx(data->ctx->dev.hdc, p->aptl[p->cptl - 1].x, p->aptl[p->cptl - 1].y, NULL); MoveToEx(data->ctx->hdc, p->aptl[p->cptl - 1].x, p->aptl[p->cptl - 1].y, NULL);
} }
case EMR_POLYLINETO: case EMR_POLYLINETO:
{ {
...@@ -2195,10 +2195,10 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2195,10 +2195,10 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
pts = malloc(sizeof(*pts) * cnt); pts = malloc(sizeof(*pts) * cnt);
if (!pts) return 0; if (!pts) return 0;
GetCurrentPositionEx(data->ctx->dev.hdc, pts); GetCurrentPositionEx(data->ctx->hdc, pts);
memcpy(pts + 1, p->aptl, sizeof(*pts) * p->cptl); memcpy(pts + 1, p->aptl, sizeof(*pts) * p->cptl);
ret = PSDRV_PolyPolyline(data->ctx, pts, &cnt, 1) && ret = PSDRV_PolyPolyline(data->ctx, pts, &cnt, 1) &&
MoveToEx(data->ctx->dev.hdc, pts[cnt - 1].x, pts[cnt - 1].y, NULL); MoveToEx(data->ctx->hdc, pts[cnt - 1].x, pts[cnt - 1].y, NULL);
free(pts); free(pts);
return ret; return ret;
} }
...@@ -2231,7 +2231,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2231,7 +2231,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
{ {
const EMRSETTEXTCOLOR *p = (const EMRSETTEXTCOLOR *)rec; const EMRSETTEXTCOLOR *p = (const EMRSETTEXTCOLOR *)rec;
SetTextColor(data->ctx->dev.hdc, p->crColor); SetTextColor(data->ctx->hdc, p->crColor);
PSDRV_SetTextColor(data->ctx, p->crColor); PSDRV_SetTextColor(data->ctx, p->crColor);
return 1; return 1;
} }
...@@ -2239,7 +2239,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2239,7 +2239,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
{ {
const EMRSETBKCOLOR *p = (const EMRSETBKCOLOR *)rec; const EMRSETBKCOLOR *p = (const EMRSETBKCOLOR *)rec;
SetBkColor(data->ctx->dev.hdc, p->crColor); SetBkColor(data->ctx->hdc, p->crColor);
PSDRV_SetBkColor(data->ctx, p->crColor); PSDRV_SetBkColor(data->ctx, p->crColor);
return 1; return 1;
} }
...@@ -2274,7 +2274,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2274,7 +2274,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
case EMR_RESTOREDC: case EMR_RESTOREDC:
{ {
const EMRRESTOREDC *p = (const EMRRESTOREDC *)rec; const EMRRESTOREDC *p = (const EMRRESTOREDC *)rec;
HDC hdc = data->ctx->dev.hdc; HDC hdc = data->ctx->hdc;
int ret = PlayEnhMetaFileRecord(hdc, htable, rec, handle_count); int ret = PlayEnhMetaFileRecord(hdc, htable, rec, handle_count);
UINT aa_flags; UINT aa_flags;
...@@ -2302,7 +2302,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2302,7 +2302,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
HGDIOBJ obj; HGDIOBJ obj;
obj = get_object_handle(data, htable, so->ihObject, &pattern); obj = get_object_handle(data, htable, so->ihObject, &pattern);
SelectObject(data->ctx->dev.hdc, obj); SelectObject(data->ctx->hdc, obj);
switch (GetObjectType(obj)) switch (GetObjectType(obj))
{ {
...@@ -2319,12 +2319,12 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2319,12 +2319,12 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
const EMRDELETEOBJECT *p = (const EMRDELETEOBJECT *)rec; const EMRDELETEOBJECT *p = (const EMRDELETEOBJECT *)rec;
memset(&data->patterns[p->ihObject], 0, sizeof(*data->patterns)); memset(&data->patterns[p->ihObject], 0, sizeof(*data->patterns));
return PlayEnhMetaFileRecord(data->ctx->dev.hdc, htable, rec, handle_count); return PlayEnhMetaFileRecord(data->ctx->hdc, htable, rec, handle_count);
} }
case EMR_ANGLEARC: case EMR_ANGLEARC:
{ {
const EMRANGLEARC *p = (const EMRANGLEARC *)rec; const EMRANGLEARC *p = (const EMRANGLEARC *)rec;
int arc_dir = SetArcDirection(data->ctx->dev.hdc, int arc_dir = SetArcDirection(data->ctx->hdc,
p->eSweepAngle >= 0 ? AD_COUNTERCLOCKWISE : AD_CLOCKWISE); p->eSweepAngle >= 0 ? AD_COUNTERCLOCKWISE : AD_CLOCKWISE);
EMRARCTO arcto; EMRARCTO arcto;
int ret; int ret;
...@@ -2344,7 +2344,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2344,7 +2344,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
sin((p->eStartAngle + p->eSweepAngle) * M_PI / 180) * p->nRadius); sin((p->eStartAngle + p->eSweepAngle) * M_PI / 180) * p->nRadius);
ret = hmf_proc(hdc, htable, (ENHMETARECORD *)&arcto, handle_count, arg); ret = hmf_proc(hdc, htable, (ENHMETARECORD *)&arcto, handle_count, arg);
SetArcDirection(data->ctx->dev.hdc, arc_dir); SetArcDirection(data->ctx->hdc, arc_dir);
return ret; return ret;
} }
case EMR_ELLIPSE: case EMR_ELLIPSE:
...@@ -2398,7 +2398,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2398,7 +2398,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
const EMRLINETO *line = (const EMRLINETO *)rec; const EMRLINETO *line = (const EMRLINETO *)rec;
return PSDRV_LineTo(data->ctx, line->ptl.x, line->ptl.y) && return PSDRV_LineTo(data->ctx, line->ptl.x, line->ptl.y) &&
MoveToEx(data->ctx->dev.hdc, line->ptl.x, line->ptl.y, NULL); MoveToEx(data->ctx->hdc, line->ptl.x, line->ptl.y, NULL);
} }
case EMR_ARCTO: case EMR_ARCTO:
{ {
...@@ -2406,10 +2406,10 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2406,10 +2406,10 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
POINT pt; POINT pt;
BOOL ret; BOOL ret;
ret = GetCurrentPositionEx(data->ctx->dev.hdc, &pt); ret = GetCurrentPositionEx(data->ctx->hdc, &pt);
if (ret) if (ret)
{ {
ret = ArcTo(data->ctx->dev.hdc, p->rclBox.left, p->rclBox.top, ret = ArcTo(data->ctx->hdc, p->rclBox.left, p->rclBox.top,
p->rclBox.right, p->rclBox.bottom, p->ptlStart.x, p->rclBox.right, p->rclBox.bottom, p->ptlStart.x,
p->ptlStart.y, p->ptlStart.x, p->ptlStart.y); p->ptlStart.y, p->ptlStart.x, p->ptlStart.y);
} }
...@@ -2423,7 +2423,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2423,7 +2423,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
} }
if (ret) if (ret)
{ {
ret = ArcTo(data->ctx->dev.hdc, p->rclBox.left, p->rclBox.top, ret = ArcTo(data->ctx->hdc, p->rclBox.left, p->rclBox.top,
p->rclBox.right, p->rclBox.bottom, p->ptlEnd.x, p->rclBox.right, p->rclBox.bottom, p->ptlEnd.x,
p->ptlEnd.y, p->ptlEnd.x, p->ptlEnd.y); p->ptlEnd.y, p->ptlEnd.x, p->ptlEnd.y);
} }
...@@ -2435,17 +2435,17 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2435,17 +2435,17 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
const POINT *pts = (const POINT *)p->aptl; const POINT *pts = (const POINT *)p->aptl;
return poly_draw(data->ctx, pts, (BYTE *)(p->aptl + p->cptl), p->cptl) && return poly_draw(data->ctx, pts, (BYTE *)(p->aptl + p->cptl), p->cptl) &&
MoveToEx(data->ctx->dev.hdc, pts[p->cptl - 1].x, pts[p->cptl - 1].y, NULL); MoveToEx(data->ctx->hdc, pts[p->cptl - 1].x, pts[p->cptl - 1].y, NULL);
} }
case EMR_BEGINPATH: case EMR_BEGINPATH:
{ {
data->path = TRUE; data->path = TRUE;
return PlayEnhMetaFileRecord(data->ctx->dev.hdc, htable, rec, handle_count); return PlayEnhMetaFileRecord(data->ctx->hdc, htable, rec, handle_count);
} }
case EMR_ENDPATH: case EMR_ENDPATH:
{ {
data->path = FALSE; data->path = FALSE;
return PlayEnhMetaFileRecord(data->ctx->dev.hdc, htable, rec, handle_count); return PlayEnhMetaFileRecord(data->ctx->hdc, htable, rec, handle_count);
} }
case EMR_FILLPATH: case EMR_FILLPATH:
PSDRV_FillPath(data->ctx); PSDRV_FillPath(data->ctx);
...@@ -2459,7 +2459,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2459,7 +2459,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
case EMR_ABORTPATH: case EMR_ABORTPATH:
{ {
data->path = FALSE; data->path = FALSE;
return PlayEnhMetaFileRecord(data->ctx->dev.hdc, htable, rec, handle_count); return PlayEnhMetaFileRecord(data->ctx->hdc, htable, rec, handle_count);
} }
case EMR_FILLRGN: case EMR_FILLRGN:
{ {
...@@ -2504,9 +2504,9 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2504,9 +2504,9 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
HRGN rgn; HRGN rgn;
rgn = ExtCreateRegion(NULL, p->cbRgnData, (const RGNDATA *)p->RgnData); rgn = ExtCreateRegion(NULL, p->cbRgnData, (const RGNDATA *)p->RgnData);
old_rop = SetROP2(data->ctx->dev.hdc, R2_NOT); old_rop = SetROP2(data->ctx->hdc, R2_NOT);
ret = fill_rgn(data, htable, handle_count, 0x80000000 | BLACK_BRUSH, rgn); ret = fill_rgn(data, htable, handle_count, 0x80000000 | BLACK_BRUSH, rgn);
SetROP2(data->ctx->dev.hdc, old_rop); SetROP2(data->ctx->hdc, old_rop);
DeleteObject(rgn); DeleteObject(rgn);
return ret; return ret;
} }
...@@ -2579,7 +2579,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2579,7 +2579,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
case EMR_EXTTEXTOUTW: case EMR_EXTTEXTOUTW:
{ {
const EMREXTTEXTOUTW *p = (const EMREXTTEXTOUTW *)rec; const EMREXTTEXTOUTW *p = (const EMREXTTEXTOUTW *)rec;
HDC hdc = data->ctx->dev.hdc; HDC hdc = data->ctx->hdc;
const INT *dx = NULL; const INT *dx = NULL;
int old_mode, ret; int old_mode, ret;
RECT rect; RECT rect;
...@@ -2669,7 +2669,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2669,7 +2669,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
pts[i].y = p->apts[i].y; pts[i].y = p->apts[i].y;
} }
i = PSDRV_PolyBezierTo(data->ctx, pts, p->cpts) && i = PSDRV_PolyBezierTo(data->ctx, pts, p->cpts) &&
MoveToEx(data->ctx->dev.hdc, pts[p->cpts - 1].x, pts[p->cpts - 1].y, NULL); MoveToEx(data->ctx->hdc, pts[p->cpts - 1].x, pts[p->cpts - 1].y, NULL);
free(pts); free(pts);
return i; return i;
} }
...@@ -2683,14 +2683,14 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2683,14 +2683,14 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
cnt = p->cpts + 1; cnt = p->cpts + 1;
pts = malloc(sizeof(*pts) * cnt); pts = malloc(sizeof(*pts) * cnt);
if (!pts) return 0; if (!pts) return 0;
GetCurrentPositionEx(data->ctx->dev.hdc, pts); GetCurrentPositionEx(data->ctx->hdc, pts);
for (i = 0; i < p->cpts; i++) for (i = 0; i < p->cpts; i++)
{ {
pts[i + 1].x = p->apts[i].x; pts[i + 1].x = p->apts[i].x;
pts[i + 1].y = p->apts[i].y; pts[i + 1].y = p->apts[i].y;
} }
i = PSDRV_PolyPolyline(data->ctx, pts, &cnt, 1) && i = PSDRV_PolyPolyline(data->ctx, pts, &cnt, 1) &&
MoveToEx(data->ctx->dev.hdc, pts[cnt - 1].x, pts[cnt - 1].y, NULL); MoveToEx(data->ctx->hdc, pts[cnt - 1].x, pts[cnt - 1].y, NULL);
free(pts); free(pts);
return i; return i;
} }
...@@ -2742,7 +2742,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2742,7 +2742,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
pts[i].y = p->apts[i].y; pts[i].y = p->apts[i].y;
} }
i = poly_draw(data->ctx, pts, (BYTE *)(p->apts + p->cpts), p->cpts) && i = poly_draw(data->ctx, pts, (BYTE *)(p->apts + p->cpts), p->cpts) &&
MoveToEx(data->ctx->dev.hdc, pts[p->cpts - 1].x, pts[p->cpts - 1].y, NULL); MoveToEx(data->ctx->hdc, pts[p->cpts - 1].x, pts[p->cpts - 1].y, NULL);
free(pts); free(pts);
return i; return i;
} }
...@@ -2750,7 +2750,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2750,7 +2750,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
{ {
const EMRCREATEMONOBRUSH *p = (const EMRCREATEMONOBRUSH *)rec; const EMRCREATEMONOBRUSH *p = (const EMRCREATEMONOBRUSH *)rec;
if (!PlayEnhMetaFileRecord(data->ctx->dev.hdc, htable, rec, handle_count)) if (!PlayEnhMetaFileRecord(data->ctx->hdc, htable, rec, handle_count))
return 0; return 0;
data->patterns[p->ihBrush].usage = p->iUsage; data->patterns[p->ihBrush].usage = p->iUsage;
data->patterns[p->ihBrush].info = (BITMAPINFO *)((BYTE *)p + p->offBmi); data->patterns[p->ihBrush].info = (BITMAPINFO *)((BYTE *)p + p->offBmi);
...@@ -2761,7 +2761,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2761,7 +2761,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
{ {
const EMRCREATEDIBPATTERNBRUSHPT *p = (const EMRCREATEDIBPATTERNBRUSHPT *)rec; const EMRCREATEDIBPATTERNBRUSHPT *p = (const EMRCREATEDIBPATTERNBRUSHPT *)rec;
if (!PlayEnhMetaFileRecord(data->ctx->dev.hdc, htable, rec, handle_count)) if (!PlayEnhMetaFileRecord(data->ctx->hdc, htable, rec, handle_count))
return 0; return 0;
data->patterns[p->ihBrush].usage = p->iUsage; data->patterns[p->ihBrush].usage = p->iUsage;
data->patterns[p->ihBrush].info = (BITMAPINFO *)((BYTE *)p + p->offBmi); data->patterns[p->ihBrush].info = (BITMAPINFO *)((BYTE *)p + p->offBmi);
...@@ -2794,7 +2794,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2794,7 +2794,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
data->break_extra = p->break_extra / p->break_count; data->break_extra = p->break_extra / p->break_count;
data->break_rem = p->break_extra - data->break_extra * p->break_count; data->break_rem = p->break_extra - data->break_extra * p->break_count;
return PlayEnhMetaFileRecord(data->ctx->dev.hdc, htable, rec, handle_count); return PlayEnhMetaFileRecord(data->ctx->hdc, htable, rec, handle_count);
} }
case EMR_EXTFLOODFILL: case EMR_EXTFLOODFILL:
...@@ -2836,7 +2836,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, ...@@ -2836,7 +2836,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
case EMR_EXTSELECTCLIPRGN: case EMR_EXTSELECTCLIPRGN:
case EMR_EXTCREATEFONTINDIRECTW: case EMR_EXTCREATEFONTINDIRECTW:
case EMR_SETLAYOUT: case EMR_SETLAYOUT:
return PlayEnhMetaFileRecord(data->ctx->dev.hdc, htable, rec, handle_count); return PlayEnhMetaFileRecord(data->ctx->hdc, htable, rec, handle_count);
default: default:
FIXME("unsupported record: %ld\n", rec->iType); FIXME("unsupported record: %ld\n", rec->iType);
} }
...@@ -2882,18 +2882,18 @@ static BOOL print_metafile(struct pp_data *data, HANDLE hdata) ...@@ -2882,18 +2882,18 @@ static BOOL print_metafile(struct pp_data *data, HANDLE hdata)
if (!hmf) if (!hmf)
return FALSE; return FALSE;
AbortPath(data->ctx->dev.hdc); AbortPath(data->ctx->hdc);
MoveToEx(data->ctx->dev.hdc, 0, 0, NULL); MoveToEx(data->ctx->hdc, 0, 0, NULL);
SetBkColor(data->ctx->dev.hdc, RGB(255, 255, 255)); SetBkColor(data->ctx->hdc, RGB(255, 255, 255));
SetBkMode(data->ctx->dev.hdc, OPAQUE); SetBkMode(data->ctx->hdc, OPAQUE);
SetMapMode(data->ctx->dev.hdc, MM_TEXT); SetMapMode(data->ctx->hdc, MM_TEXT);
SetPolyFillMode(data->ctx->dev.hdc, ALTERNATE); SetPolyFillMode(data->ctx->hdc, ALTERNATE);
SetROP2(data->ctx->dev.hdc, R2_COPYPEN); SetROP2(data->ctx->hdc, R2_COPYPEN);
SetStretchBltMode(data->ctx->dev.hdc, BLACKONWHITE); SetStretchBltMode(data->ctx->hdc, BLACKONWHITE);
SetTextAlign(data->ctx->dev.hdc, TA_LEFT | TA_TOP); SetTextAlign(data->ctx->hdc, TA_LEFT | TA_TOP);
SetTextColor(data->ctx->dev.hdc, 0); SetTextColor(data->ctx->hdc, 0);
SetTextJustification(data->ctx->dev.hdc, 0, 0); SetTextJustification(data->ctx->hdc, 0, 0);
SetWorldTransform(data->ctx->dev.hdc, &xform); SetWorldTransform(data->ctx->hdc, &xform);
PSDRV_SetTextColor(data->ctx, 0); PSDRV_SetTextColor(data->ctx, 0);
PSDRV_SetBkColor(data->ctx, RGB(255, 255, 255)); PSDRV_SetBkColor(data->ctx, RGB(255, 255, 255));
...@@ -3158,7 +3158,7 @@ BOOL WINAPI ClosePrintProcessor(HANDLE pp) ...@@ -3158,7 +3158,7 @@ BOOL WINAPI ClosePrintProcessor(HANDLE pp)
ClosePrinter(data->hport); ClosePrinter(data->hport);
free(data->doc_name); free(data->doc_name);
free(data->out_file); free(data->out_file);
DeleteDC(data->ctx->dev.hdc); DeleteDC(data->ctx->hdc);
HeapFree(GetProcessHeap(), 0, data->ctx->Devmode); HeapFree(GetProcessHeap(), 0, data->ctx->Devmode);
HeapFree(GetProcessHeap(), 0, data->ctx); HeapFree(GetProcessHeap(), 0, data->ctx);
free(data->saved_dc); free(data->saved_dc);
......
...@@ -976,8 +976,8 @@ BOOL PSDRV_WriteDIBPatternDict(print_ctx *ctx, const BITMAPINFO *bmi, BYTE *bits ...@@ -976,8 +976,8 @@ BOOL PSDRV_WriteDIBPatternDict(print_ctx *ctx, const BITMAPINFO *bmi, BYTE *bits
PSDRV_WriteSpool(ctx, "def\n", 4); PSDRV_WriteSpool(ctx, "def\n", 4);
PSDRV_WriteIndexColorSpaceBegin(ctx, 1); PSDRV_WriteIndexColorSpaceBegin(ctx, 1);
map[0] = GetTextColor( ctx->dev.hdc ); map[0] = GetTextColor( ctx->hdc );
map[1] = GetBkColor( ctx->dev.hdc ); map[1] = GetBkColor( ctx->hdc );
PSDRV_WriteRGB(ctx, map, 2); PSDRV_WriteRGB(ctx, map, 2);
PSDRV_WriteIndexColorSpaceEnd(ctx); PSDRV_WriteIndexColorSpaceEnd(ctx);
......
...@@ -356,7 +356,7 @@ typedef struct { ...@@ -356,7 +356,7 @@ typedef struct {
typedef struct typedef struct
{ {
struct gdi_physdev dev; HDC hdc;
PSFONT font; /* Current PS font */ PSFONT font; /* Current PS font */
DOWNLOAD *downloaded_fonts; DOWNLOAD *downloaded_fonts;
PSPEN pen; PSPEN pen;
......
...@@ -65,7 +65,7 @@ static Run* build_vertical_runs(print_ctx *ctx, UINT flags, LPCWSTR str, UINT co ...@@ -65,7 +65,7 @@ static Run* build_vertical_runs(print_ctx *ctx, UINT flags, LPCWSTR str, UINT co
int index = 0; int index = 0;
LOGFONTW lf; LOGFONTW lf;
if (count && str && (!(flags & ETO_GLYPH_INDEX)) && GetObjectW( GetCurrentObject(ctx->dev.hdc, OBJ_FONT), sizeof(lf), &lf ) && (lf.lfFaceName[0] == '@')) if (count && str && (!(flags & ETO_GLYPH_INDEX)) && GetObjectW( GetCurrentObject(ctx->hdc, OBJ_FONT), sizeof(lf), &lf ) && (lf.lfFaceName[0] == '@'))
{ {
last_vert = check_unicode_tategaki(str[0]); last_vert = check_unicode_tategaki(str[0]);
start = end = 0; start = end = 0;
...@@ -84,14 +84,14 @@ static Run* build_vertical_runs(print_ctx *ctx, UINT flags, LPCWSTR str, UINT co ...@@ -84,14 +84,14 @@ static Run* build_vertical_runs(print_ctx *ctx, UINT flags, LPCWSTR str, UINT co
if (run[index].vertical) if (run[index].vertical)
{ {
TEXTMETRICW tm; TEXTMETRICW tm;
GetTextMetricsW(ctx->dev.hdc, &tm); GetTextMetricsW(ctx->hdc, &tm);
offset += PSDRV_XWStoDS(ctx, tm.tmAscent - tm.tmInternalLeading); offset += PSDRV_XWStoDS(ctx, tm.tmAscent - tm.tmInternalLeading);
} }
if (start > 0) if (start > 0)
{ {
SIZE size; SIZE size;
GetTextExtentPointW(ctx->dev.hdc, str, start, &size); GetTextExtentPointW(ctx->hdc, str, start, &size);
offset += PSDRV_XWStoDS(ctx, size.cx); offset += PSDRV_XWStoDS(ctx, size.cx);
} }
...@@ -215,7 +215,7 @@ static BOOL PSDRV_Text(print_ctx *ctx, INT x, INT y, UINT flags, LPCWSTR str, ...@@ -215,7 +215,7 @@ static BOOL PSDRV_Text(print_ctx *ctx, INT x, INT y, UINT flags, LPCWSTR str,
if(ctx->font.fontloc == Download && !(flags & ETO_GLYPH_INDEX)) if(ctx->font.fontloc == Download && !(flags & ETO_GLYPH_INDEX))
{ {
glyphs = HeapAlloc( GetProcessHeap(), 0, count * sizeof(WORD) ); glyphs = HeapAlloc( GetProcessHeap(), 0, count * sizeof(WORD) );
GetGlyphIndicesW( ctx->dev.hdc, str, count, glyphs, 0 ); GetGlyphIndicesW( ctx->hdc, str, count, glyphs, 0 );
str = glyphs; str = glyphs;
} }
......
...@@ -568,9 +568,9 @@ BOOL T1_download_glyph(print_ctx *ctx, DOWNLOAD *pdl, DWORD index, char *glyph_n ...@@ -568,9 +568,9 @@ BOOL T1_download_glyph(print_ctx *ctx, DOWNLOAD *pdl, DWORD index, char *glyph_n
outline.flags = NULL; outline.flags = NULL;
outline.end_pts = NULL; outline.end_pts = NULL;
outline.pts = NULL; outline.pts = NULL;
get_hmetrics(ctx->dev.hdc, index, &outline.lsb, &outline.advance); get_hmetrics(ctx->hdc, index, &outline.lsb, &outline.advance);
if(!append_glyph_outline(ctx->dev.hdc, index, &outline)) return FALSE; if(!append_glyph_outline(ctx->hdc, index, &outline)) return FALSE;
charstring = str_init(100); charstring = str_init(100);
curpos.x = outline.lsb; curpos.x = outline.lsb;
......
...@@ -175,7 +175,7 @@ TYPE42 *T42_download_header(print_ctx *ctx, char *ps_name, ...@@ -175,7 +175,7 @@ TYPE42 *T42_download_header(print_ctx *ctx, 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(ctx->dev.hdc, t42->tables + i); LoadTable(ctx->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'))
...@@ -328,7 +328,7 @@ BOOL T42_download_glyph(print_ctx *ctx, DOWNLOAD *pdl, DWORD index, ...@@ -328,7 +328,7 @@ BOOL T42_download_glyph(print_ctx *ctx, DOWNLOAD *pdl, DWORD index,
sg_index = GET_BE_WORD(sg_start + 2); sg_index = GET_BE_WORD(sg_start + 2);
TRACE("Sending subglyph %04lx for glyph %04lx\n", sg_index, index); TRACE("Sending subglyph %04lx for glyph %04lx\n", sg_index, index);
get_glyph_name(ctx->dev.hdc, sg_index, sg_name); get_glyph_name(ctx->hdc, sg_index, sg_name);
T42_download_glyph(ctx, pdl, sg_index, sg_name); T42_download_glyph(ctx, 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)
......
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