From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/bitmap.c | 2 +- dlls/wineps.drv/brush.c | 8 +-- dlls/wineps.drv/builtin.c | 4 +- dlls/wineps.drv/clipping.c | 6 +- dlls/wineps.drv/download.c | 26 ++++---- dlls/wineps.drv/escape.c | 6 +- dlls/wineps.drv/font.c | 2 +- dlls/wineps.drv/graphics.c | 52 +++++++-------- dlls/wineps.drv/init.c | 2 +- dlls/wineps.drv/pen.c | 4 +- dlls/wineps.drv/printproc.c | 126 ++++++++++++++++++------------------ dlls/wineps.drv/ps.c | 4 +- dlls/wineps.drv/psdrv.h | 2 +- dlls/wineps.drv/text.c | 8 +-- dlls/wineps.drv/type1.c | 4 +- dlls/wineps.drv/type42.c | 4 +- 16 files changed, 130 insertions(+), 130 deletions(-)
diff --git a/dlls/wineps.drv/bitmap.c b/dlls/wineps.drv/bitmap.c index fecd02fbf27..69f93b2ea69 100644 --- a/dlls/wineps.drv/bitmap.c +++ b/dlls/wineps.drv/bitmap.c @@ -110,7 +110,7 @@ static BOOL PSDRV_WriteImageMaskHeader(print_ctx *ctx, const BITMAPINFO *info, I */ if (!info->bmiHeader.biClrUsed) { - PSDRV_CreateColor( ctx, &foregnd, GetTextColor( ctx->dev.hdc ) ); + PSDRV_CreateColor( ctx, &foregnd, GetTextColor( ctx->hdc ) ); bkgnd = ctx->bkColor; } else diff --git a/dlls/wineps.drv/brush.c b/dlls/wineps.drv/brush.c index 3d9bd8042b3..0c3dabd387f 100644 --- a/dlls/wineps.drv/brush.c +++ b/dlls/wineps.drv/brush.c @@ -36,7 +36,7 @@ HBRUSH CDECL PSDRV_SelectBrush( print_ctx *ctx, HBRUSH hbrush, const struct brus TRACE("hbrush = %p\n", hbrush);
if (hbrush == GetStockObject( DC_BRUSH )) - logbrush.lbColor = GetDCBrushColor( ctx->dev.hdc ); + logbrush.lbColor = GetDCBrushColor( ctx->hdc );
switch(logbrush.lbStyle) {
@@ -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 ) { - 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 ); ctx->brush.set = FALSE; @@ -90,7 +90,7 @@ static BOOL PSDRV_SetBrush( print_ctx *ctx ) LOGBRUSH logbrush; 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"); return FALSE; @@ -155,7 +155,7 @@ BOOL PSDRV_Brush(print_ctx *ctx, BOOL EO) if(ctx->pathdepth) 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"); return FALSE; diff --git a/dlls/wineps.drv/builtin.c b/dlls/wineps.drv/builtin.c index 5ce1b3c7212..2a2c9106f12 100644 --- a/dlls/wineps.drv/builtin.c +++ b/dlls/wineps.drv/builtin.c @@ -41,7 +41,7 @@ BOOL PSDRV_WriteSetBuiltinFont(print_ctx *ctx) struct font_info font_info; 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); size.xx = font_info.size.cx; size.yy = font_info.size.cy; @@ -57,7 +57,7 @@ BOOL PSDRV_WriteBuiltinGlyphShow(print_ctx *ctx, LPCWSTR str, INT count)
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); }
diff --git a/dlls/wineps.drv/clipping.c b/dlls/wineps.drv/clipping.c index 4b387a77600..9cf030e45b7 100644 --- a/dlls/wineps.drv/clipping.c +++ b/dlls/wineps.drv/clipping.c @@ -80,7 +80,7 @@ void PSDRV_SetClip( print_ctx *ctx ) { HRGN hrgn;
- TRACE("hdc=%p\n", ctx->dev.hdc); + TRACE("hdc=%p\n", ctx->hdc);
if(ctx->pathdepth) { TRACE("inside a path, so not clipping\n"); @@ -88,7 +88,7 @@ void PSDRV_SetClip( print_ctx *ctx ) }
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_AddClip( ctx, hrgn ); @@ -107,7 +107,7 @@ void PSDRV_ResetClip( print_ctx *ctx ) if (ctx->pathdepth) return;
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); DeleteObject(hrgn); } diff --git a/dlls/wineps.drv/download.c b/dlls/wineps.drv/download.c index 7dcdcac3ab8..89dd56d5b38 100644 --- a/dlls/wineps.drv/download.c +++ b/dlls/wineps.drv/download.c @@ -57,7 +57,7 @@ static void get_download_name(print_ctx *ctx, LPOUTLINETEXTMETRICA potm, char ** char *p; 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) { BYTE *name = HeapAlloc(GetProcessHeap(), 0, size); @@ -75,7 +75,7 @@ static void get_download_name(print_ctx *ctx, LPOUTLINETEXTMETRICA potm, char ** USHORT offset; } *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); strings = name + GET_BE_WORD(name + 4); name_record = (struct name_record *)(name + 6); @@ -266,7 +266,7 @@ BOOL PSDRV_WriteSetDownloadFont(print_ctx *ctx, BOOL vertical) { char *ps_name; LPOUTLINETEXTMETRICA potm; - DWORD len = GetOutlineTextMetricsA(ctx->dev.hdc, 0, NULL); + DWORD len = GetOutlineTextMetricsA(ctx->hdc, 0, NULL); DOWNLOAD *pdl; LOGFONTW lf; UINT ppem; @@ -275,24 +275,24 @@ BOOL PSDRV_WriteSetDownloadFont(print_ctx *ctx, BOOL vertical)
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;
potm = HeapAlloc(GetProcessHeap(), 0, len); if (!potm) return FALSE;
- GetOutlineTextMetricsA(ctx->dev.hdc, len, potm); + GetOutlineTextMetricsA(ctx->hdc, len, potm);
get_download_name(ctx, potm, &ps_name, vertical); 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 */ - 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; xform.eM11 = xform.eM22 = fabs(xform.eM22); @@ -306,7 +306,7 @@ BOOL PSDRV_WriteSetDownloadFont(print_ctx *ctx, BOOL vertical)
if(ctx->font.fontinfo.Download == NULL) { RECT bbox; - UINT emsize = get_bbox(ctx->dev.hdc, &bbox); + UINT emsize = get_bbox(ctx->hdc, &bbox);
if (!emsize) { HeapFree(GetProcessHeap(), 0, ps_name); @@ -335,7 +335,7 @@ BOOL PSDRV_WriteSetDownloadFont(print_ctx *ctx, BOOL vertical)
if(pdl->type == Type42) { 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); } } @@ -345,7 +345,7 @@ BOOL PSDRV_WriteSetDownloadFont(print_ctx *ctx, BOOL vertical) escapement += 900;
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, potm); @@ -746,7 +746,7 @@ BOOL PSDRV_WriteDownloadGlyphShow(print_ctx *ctx, const WORD *glyphs, switch(ctx->font.fontinfo.Download->type) { case Type42: 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); PSDRV_WriteGlyphShow(ctx, g_name); } @@ -754,7 +754,7 @@ BOOL PSDRV_WriteDownloadGlyphShow(print_ctx *ctx, const WORD *glyphs,
case Type1: 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); PSDRV_WriteGlyphShow(ctx, g_name); } diff --git a/dlls/wineps.drv/escape.c b/dlls/wineps.drv/escape.c index 095affc2a0a..1d639d0c3d4 100644 --- a/dlls/wineps.drv/escape.c +++ b/dlls/wineps.drv/escape.c @@ -55,7 +55,7 @@ INT CDECL PSDRV_ExtEscape( print_ctx *ctx, INT nEscape, INT cbInput, LPCVOID in_ INT cbOutput, LPVOID out_data ) { 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) { @@ -152,7 +152,7 @@ INT CDECL PSDRV_ExtEscape( print_ctx *ctx, INT nEscape, INT cbInput, LPCVOID in_ */ INT CDECL PSDRV_StartPage( print_ctx *ctx ) { - TRACE("%p\n", ctx->dev.hdc); + TRACE("%p\n", ctx->hdc);
if(!ctx->job.OutOfPage) { FIXME("Already started a page?\n"); @@ -173,7 +173,7 @@ INT CDECL PSDRV_StartPage( 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) { FIXME("Already ended a page?\n"); diff --git a/dlls/wineps.drv/font.c b/dlls/wineps.drv/font.c index 6925ddc160c..869eb0ea9b6 100644 --- a/dlls/wineps.drv/font.c +++ b/dlls/wineps.drv/font.c @@ -42,7 +42,7 @@ HFONT CDECL PSDRV_SelectFont( print_ctx *ctx, HFONT hfont, UINT *aa_flags ) { 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)) { ctx->font.fontloc = Builtin; diff --git a/dlls/wineps.drv/graphics.c b/dlls/wineps.drv/graphics.c index d571b4c76be..49af41c68a8 100644 --- a/dlls/wineps.drv/graphics.c +++ b/dlls/wineps.drv/graphics.c @@ -44,7 +44,7 @@ INT PSDRV_XWStoDS( print_ctx *ctx, INT width ) pt[0].y = 0; pt[1].x = width; pt[1].y = 0; - LPtoDP( ctx->dev.hdc, pt, 2 ); + LPtoDP( ctx->hdc, pt, 2 ); return pt[1].x - pt[0].x; }
@@ -71,10 +71,10 @@ BOOL CDECL PSDRV_LineTo(print_ctx *ctx, INT x, INT y)
TRACE("%d %d\n", x, y);
- GetCurrentPositionEx( ctx->dev.hdc, pt ); + GetCurrentPositionEx( ctx->hdc, pt ); pt[1].x = x; pt[1].y = y; - LPtoDP( ctx->dev.hdc, pt, 2 ); + LPtoDP( ctx->hdc, pt, 2 );
PSDRV_SetPen(ctx);
@@ -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);
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 and our rop is R2_NOP, then we output the string below. This is used in 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];
@@ -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[1], 0, 0, ell_width, ell_height); - LPtoDP( ctx->dev.hdc, (POINT *)rect, 4 ); + LPtoDP( ctx->hdc, (POINT *)rect, 4 );
left = rect[0].left; top = rect[0].top; @@ -188,13 +188,13 @@ static BOOL PSDRV_DrawArc( print_ctx *ctx, INT left, INT top, POINT start, end;
SetRect(&rect, left, top, right, bottom); - LPtoDP( ctx->dev.hdc, (POINT *)&rect, 2 ); + LPtoDP( ctx->hdc, (POINT *)&rect, 2 ); start.x = xstart; start.y = ystart; end.x = xend; end.y = yend; - LPtoDP( ctx->dev.hdc, &start, 1 ); - LPtoDP( ctx->dev.hdc, &end, 1 ); + LPtoDP( ctx->hdc, &start, 1 ); + LPtoDP( ctx->hdc, &end, 1 );
x = (rect.left + rect.right) / 2; y = (rect.top + rect.bottom) / 2; @@ -223,7 +223,7 @@ static BOOL PSDRV_DrawArc( print_ctx *ctx, INT left, INT top, else 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); else 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 TRACE("%d %d - %d %d\n", 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; y = (rect.top + rect.bottom) / 2; @@ -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]; if (!(dev_pts = HeapAlloc( GetProcessHeap(), 0, total * sizeof(*dev_pts) ))) return FALSE; memcpy( dev_pts, pts, total * sizeof(*dev_pts) ); - LPtoDP( ctx->dev.hdc, dev_pts, total ); + LPtoDP( ctx->hdc, dev_pts, total );
pt = dev_pts;
@@ -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]; if (!(dev_pts = HeapAlloc( GetProcessHeap(), 0, total * sizeof(*dev_pts) ))) return FALSE; memcpy( dev_pts, pts, total * sizeof(*dev_pts) ); - LPtoDP( ctx->dev.hdc, dev_pts, total ); + LPtoDP( ctx->hdc, dev_pts, total );
pt = dev_pts;
@@ -365,7 +365,7 @@ BOOL CDECL PSDRV_PolyPolygon( print_ctx *ctx, const POINT* pts, const INT* count } HeapFree( GetProcessHeap(), 0, dev_pts );
- if(GetPolyFillMode( ctx->dev.hdc ) == ALTERNATE) + if(GetPolyFillMode( ctx->hdc ) == ALTERNATE) PSDRV_Brush(ctx, 1); else /* WINDING */ PSDRV_Brush(ctx, 0); @@ -383,7 +383,7 @@ static BOOL poly_bezier( print_ctx *ctx, const POINT *pt0, const POINT *pts, DWO TRACE( "\n" );
dev_pts[0] = *pt0; - LPtoDP( ctx->dev.hdc, dev_pts, 1 ); + LPtoDP( ctx->hdc, dev_pts, 1 );
PSDRV_WriteSpool( ctx, "%PolyBezier\n", 12 ); PSDRV_SetPen( ctx ); @@ -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) { 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_DrawLine(ctx); @@ -416,7 +416,7 @@ BOOL CDECL PSDRV_PolyBezierTo( print_ctx *ctx, const POINT *pts, DWORD count ) { POINT pt0;
- GetCurrentPositionEx( ctx->dev.hdc, &pt0 ); + GetCurrentPositionEx( ctx->hdc, &pt0 ); return poly_bezier( ctx, &pt0, pts, count ); }
@@ -431,7 +431,7 @@ COLORREF CDECL PSDRV_SetPixel( print_ctx *ctx, INT x, INT y, COLORREF color )
pt.x = x; pt.y = y; - LPtoDP( ctx->dev.hdc, &pt, 1 ); + LPtoDP( ctx->hdc, &pt, 1 );
PSDRV_SetClip(ctx); /* 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 ) RECT *pRect; DWORD size, i;
- TRACE("hdc=%p\n", ctx->dev.hdc); + TRACE("hdc=%p\n", ctx->hdc);
size = GetRegionData(hrgn, 0, NULL); rgndata = HeapAlloc( GetProcessHeap(), 0, size ); @@ -468,7 +468,7 @@ BOOL CDECL PSDRV_PaintRgn( print_ctx *ctx, HRGN hrgn ) if (rgndata->rdh.nCount == 0) 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); 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 ) { POINT *points; 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) { - AbortPath( ctx->dev.hdc ); + AbortPath( ctx->hdc ); return TRUE; } points = HeapAlloc( GetProcessHeap(), 0, size * sizeof(*points) ); types = HeapAlloc( GetProcessHeap(), 0, size * sizeof(*types) ); if (!points || !types) goto done; - if (GetPath( ctx->dev.hdc, points, types, size ) == -1) goto done; - LPtoDP( ctx->dev.hdc, points, size ); + if (GetPath( ctx->hdc, points, types, size ) == -1) goto done; + LPtoDP( ctx->hdc, points, size );
if (stroke) PSDRV_SetPen(ctx); PSDRV_SetClip(ctx); @@ -523,11 +523,11 @@ static BOOL paint_path( print_ctx *ctx, BOOL stroke, BOOL fill ) 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); else PSDRV_WriteNewPath(ctx); PSDRV_ResetClip(ctx); - AbortPath( ctx->dev.hdc ); + AbortPath( ctx->hdc );
done: HeapFree( GetProcessHeap(), 0, points ); diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c index c4745d1fd96..96b0b1689fa 100644 --- a/dlls/wineps.drv/init.c +++ b/dlls/wineps.drv/init.c @@ -372,7 +372,7 @@ print_ctx *create_print_ctx( HDC hdc, const WCHAR *device, }
PSDRV_UpdateDevCaps( ctx ); - ctx->dev.hdc = hdc; + ctx->hdc = hdc; SelectObject( hdc, GetStockObject( DEVICE_DEFAULT_FONT )); return ctx; } diff --git a/dlls/wineps.drv/pen.c b/dlls/wineps.drv/pen.c index da3915824a1..f8b828b3444 100644 --- a/dlls/wineps.drv/pen.c +++ b/dlls/wineps.drv/pen.c @@ -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 (hpen == GetStockObject( DC_PEN )) - logpen.lopnColor = GetDCPenColor( ctx->dev.hdc ); + logpen.lopnColor = GetDCPenColor( ctx->hdc );
switch (logpen.lopnStyle & PS_JOIN_MASK) { @@ -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 ) { - 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 ); return color; } diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index ea31272f655..be7a12dd693 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -355,13 +355,13 @@ static int stretch_blt(print_ctx *ctx, const EMRSTRETCHBLT *blt, dst.log_y = blt->yDest; dst.log_width = blt->cxDest; dst.log_height = blt->cyDest; - dst.layout = GetLayout(ctx->dev.hdc); + dst.layout = GetLayout(ctx->hdc); if (blt->dwRop & NOMIRRORBITMAP) dst.layout |= LAYOUT_BITMAPORIENTATIONPRESERVED;
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); }
@@ -371,7 +371,7 @@ static int stretch_blt(print_ctx *ctx, const EMRSTRETCHBLT *blt, src.log_height = blt->cySrc; 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);
memcpy(dst_info, bi, blt->cbBmiSrc); @@ -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);
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); DeleteObject(bmp1); - brush_dest = SelectObject(ctx->dev.hdc, GetStockObject(NULL_BRUSH)); + brush_dest = SelectObject(ctx->hdc, GetStockObject(NULL_BRUSH));
/* make bitmap */ hdc1 = CreateCompatibleDC(NULL); @@ -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);
/* restore all objects */ - SelectObject(ctx->dev.hdc, brush_dest); + SelectObject(ctx->hdc, brush_dest); SelectObject(hdc1, old_bmp1); SelectObject(hdc2, old_bmp2); SelectObject(hdc_src, old_bmp_src); @@ -723,8 +723,8 @@ static int plg_blt(print_ctx *ctx, const EMRPLGBLT *p)
combine_transform(&xf, &xf, &p->xformSrc);
- GetTransform(ctx->dev.hdc, 0x203, &xform_dest); - SetWorldTransform(ctx->dev.hdc, &xf); + GetTransform(ctx->hdc, 0x203, &xform_dest); + SetWorldTransform(ctx->hdc, &xf); /* now destination and source DCs use same coords */ maskblt.rclBounds = p->rclBounds; maskblt.xDest = p->xSrc; @@ -753,7 +753,7 @@ static int plg_blt(print_ctx *ctx, const EMRPLGBLT *p) mask_bi = (const BITMAPINFO *)((BYTE *)p + p->offBmiMask); mask_bits = (BYTE *)p + p->offBitsMask; 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; }
@@ -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.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); for (i = 0; i < size; i++) { @@ -810,14 +810,14 @@ static int set_di_bits_to_device(print_ctx *ctx, const EMRSETDIBITSTODEVICE *p) bi->bmiHeader.biBitCount = 24; } 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) 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); - SelectObject(ctx->dev.hdc, old_bitmap); + SelectObject(ctx->hdc, old_bitmap); if (ret) { EMRSTRETCHBLT blt; @@ -860,7 +860,7 @@ static int stretch_di_bits(print_ctx *ctx, const EMRSTRETCHDIBITS *p) HPALETTE hpal; 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); for (i = 0; i < size; i++) { @@ -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;
for (i = 0; i < count; i++) @@ -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; memcpy(pts, vert_array, sizeof(*pts) * nvert); 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 */ reset_bounds(&dst.visrect); @@ -997,7 +997,7 @@ static BOOL gradient_fill(print_ctx *ctx, const TRIVERTEX *vert_array, DWORD nve dst.y = dst.visrect.top; dst.width = dst.visrect.right - dst.visrect.left; 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.biPlanes = 1; @@ -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, const WCHAR *str, UINT count, const INT *dx) { - HDC hdc = data->ctx->dev.hdc; + HDC hdc = data->ctx->hdc; BOOL ret = FALSE; UINT align; DWORD layout; @@ -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); PSDRV_SelectBrush(data->ctx, hbrush, pattern); 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); return ret; } @@ -2146,7 +2146,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, struct pp_data *data = (struct pp_data *)arg;
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) { @@ -2182,7 +2182,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, const EMRPOLYBEZIERTO *p = (const EMRPOLYBEZIERTO *)rec;
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: { @@ -2195,10 +2195,10 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, pts = malloc(sizeof(*pts) * cnt); if (!pts) return 0;
- GetCurrentPositionEx(data->ctx->dev.hdc, pts); + GetCurrentPositionEx(data->ctx->hdc, pts); memcpy(pts + 1, p->aptl, sizeof(*pts) * p->cptl); 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); return ret; } @@ -2231,7 +2231,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, { 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); return 1; } @@ -2239,7 +2239,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, { 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); return 1; } @@ -2274,7 +2274,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, case EMR_RESTOREDC: { 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); UINT aa_flags;
@@ -2302,7 +2302,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, HGDIOBJ obj;
obj = get_object_handle(data, htable, so->ihObject, &pattern); - SelectObject(data->ctx->dev.hdc, obj); + SelectObject(data->ctx->hdc, obj);
switch (GetObjectType(obj)) { @@ -2319,12 +2319,12 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, const EMRDELETEOBJECT *p = (const EMRDELETEOBJECT *)rec;
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: { 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); EMRARCTO arcto; int ret; @@ -2344,7 +2344,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, sin((p->eStartAngle + p->eSweepAngle) * M_PI / 180) * p->nRadius);
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; } case EMR_ELLIPSE: @@ -2398,7 +2398,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, const EMRLINETO *line = (const EMRLINETO *)rec;
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: { @@ -2406,10 +2406,10 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, POINT pt; BOOL ret;
- ret = GetCurrentPositionEx(data->ctx->dev.hdc, &pt); + ret = GetCurrentPositionEx(data->ctx->hdc, &pt); 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->ptlStart.y, p->ptlStart.x, p->ptlStart.y); } @@ -2423,7 +2423,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, } 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->ptlEnd.y, p->ptlEnd.x, p->ptlEnd.y); } @@ -2435,17 +2435,17 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, const POINT *pts = (const POINT *)p->aptl;
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: { 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: { 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: PSDRV_FillPath(data->ctx); @@ -2459,7 +2459,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, case EMR_ABORTPATH: { 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: { @@ -2504,9 +2504,9 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, HRGN rgn;
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); - SetROP2(data->ctx->dev.hdc, old_rop); + SetROP2(data->ctx->hdc, old_rop); DeleteObject(rgn); return ret; } @@ -2579,7 +2579,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, case EMR_EXTTEXTOUTW: { const EMREXTTEXTOUTW *p = (const EMREXTTEXTOUTW *)rec; - HDC hdc = data->ctx->dev.hdc; + HDC hdc = data->ctx->hdc; const INT *dx = NULL; int old_mode, ret; RECT rect; @@ -2669,7 +2669,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, pts[i].y = p->apts[i].y; } 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); return i; } @@ -2683,14 +2683,14 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, cnt = p->cpts + 1; pts = malloc(sizeof(*pts) * cnt); if (!pts) return 0; - GetCurrentPositionEx(data->ctx->dev.hdc, pts); + GetCurrentPositionEx(data->ctx->hdc, pts); for (i = 0; i < p->cpts; i++) { pts[i + 1].x = p->apts[i].x; pts[i + 1].y = p->apts[i].y; } 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); return i; } @@ -2742,7 +2742,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, pts[i].y = p->apts[i].y; } 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); return i; } @@ -2750,7 +2750,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, { 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; data->patterns[p->ihBrush].usage = p->iUsage; data->patterns[p->ihBrush].info = (BITMAPINFO *)((BYTE *)p + p->offBmi); @@ -2761,7 +2761,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, { 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; data->patterns[p->ihBrush].usage = p->iUsage; data->patterns[p->ihBrush].info = (BITMAPINFO *)((BYTE *)p + p->offBmi); @@ -2794,7 +2794,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
data->break_extra = p->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: @@ -2836,7 +2836,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, case EMR_EXTSELECTCLIPRGN: case EMR_EXTCREATEFONTINDIRECTW: case EMR_SETLAYOUT: - return PlayEnhMetaFileRecord(data->ctx->dev.hdc, htable, rec, handle_count); + return PlayEnhMetaFileRecord(data->ctx->hdc, htable, rec, handle_count); default: FIXME("unsupported record: %ld\n", rec->iType); } @@ -2882,18 +2882,18 @@ static BOOL print_metafile(struct pp_data *data, HANDLE hdata) if (!hmf) return FALSE;
- AbortPath(data->ctx->dev.hdc); - MoveToEx(data->ctx->dev.hdc, 0, 0, NULL); - SetBkColor(data->ctx->dev.hdc, RGB(255, 255, 255)); - SetBkMode(data->ctx->dev.hdc, OPAQUE); - SetMapMode(data->ctx->dev.hdc, MM_TEXT); - SetPolyFillMode(data->ctx->dev.hdc, ALTERNATE); - SetROP2(data->ctx->dev.hdc, R2_COPYPEN); - SetStretchBltMode(data->ctx->dev.hdc, BLACKONWHITE); - SetTextAlign(data->ctx->dev.hdc, TA_LEFT | TA_TOP); - SetTextColor(data->ctx->dev.hdc, 0); - SetTextJustification(data->ctx->dev.hdc, 0, 0); - SetWorldTransform(data->ctx->dev.hdc, &xform); + AbortPath(data->ctx->hdc); + MoveToEx(data->ctx->hdc, 0, 0, NULL); + SetBkColor(data->ctx->hdc, RGB(255, 255, 255)); + SetBkMode(data->ctx->hdc, OPAQUE); + SetMapMode(data->ctx->hdc, MM_TEXT); + SetPolyFillMode(data->ctx->hdc, ALTERNATE); + SetROP2(data->ctx->hdc, R2_COPYPEN); + SetStretchBltMode(data->ctx->hdc, BLACKONWHITE); + SetTextAlign(data->ctx->hdc, TA_LEFT | TA_TOP); + SetTextColor(data->ctx->hdc, 0); + SetTextJustification(data->ctx->hdc, 0, 0); + SetWorldTransform(data->ctx->hdc, &xform); PSDRV_SetTextColor(data->ctx, 0); PSDRV_SetBkColor(data->ctx, RGB(255, 255, 255));
@@ -3158,7 +3158,7 @@ BOOL WINAPI ClosePrintProcessor(HANDLE pp) ClosePrinter(data->hport); free(data->doc_name); free(data->out_file); - DeleteDC(data->ctx->dev.hdc); + DeleteDC(data->ctx->hdc); HeapFree(GetProcessHeap(), 0, data->ctx->Devmode); HeapFree(GetProcessHeap(), 0, data->ctx); free(data->saved_dc); diff --git a/dlls/wineps.drv/ps.c b/dlls/wineps.drv/ps.c index 94a8e571eec..4782599d16f 100644 --- a/dlls/wineps.drv/ps.c +++ b/dlls/wineps.drv/ps.c @@ -976,8 +976,8 @@ BOOL PSDRV_WriteDIBPatternDict(print_ctx *ctx, const BITMAPINFO *bmi, BYTE *bits PSDRV_WriteSpool(ctx, "def\n", 4);
PSDRV_WriteIndexColorSpaceBegin(ctx, 1); - map[0] = GetTextColor( ctx->dev.hdc ); - map[1] = GetBkColor( ctx->dev.hdc ); + map[0] = GetTextColor( ctx->hdc ); + map[1] = GetBkColor( ctx->hdc ); PSDRV_WriteRGB(ctx, map, 2); PSDRV_WriteIndexColorSpaceEnd(ctx);
diff --git a/dlls/wineps.drv/psdrv.h b/dlls/wineps.drv/psdrv.h index 9ef53f5a805..65894c9d75a 100644 --- a/dlls/wineps.drv/psdrv.h +++ b/dlls/wineps.drv/psdrv.h @@ -356,7 +356,7 @@ typedef struct {
typedef struct { - struct gdi_physdev dev; + HDC hdc; PSFONT font; /* Current PS font */ DOWNLOAD *downloaded_fonts; PSPEN pen; diff --git a/dlls/wineps.drv/text.c b/dlls/wineps.drv/text.c index c69c037ee3b..eaee95a5025 100644 --- a/dlls/wineps.drv/text.c +++ b/dlls/wineps.drv/text.c @@ -65,7 +65,7 @@ static Run* build_vertical_runs(print_ctx *ctx, UINT flags, LPCWSTR str, UINT co int index = 0; 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]); start = end = 0; @@ -84,14 +84,14 @@ static Run* build_vertical_runs(print_ctx *ctx, UINT flags, LPCWSTR str, UINT co if (run[index].vertical) { TEXTMETRICW tm; - GetTextMetricsW(ctx->dev.hdc, &tm); + GetTextMetricsW(ctx->hdc, &tm); offset += PSDRV_XWStoDS(ctx, tm.tmAscent - tm.tmInternalLeading); }
if (start > 0) { SIZE size; - GetTextExtentPointW(ctx->dev.hdc, str, start, &size); + GetTextExtentPointW(ctx->hdc, str, start, &size); 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, if(ctx->font.fontloc == Download && !(flags & ETO_GLYPH_INDEX)) { glyphs = HeapAlloc( GetProcessHeap(), 0, count * sizeof(WORD) ); - GetGlyphIndicesW( ctx->dev.hdc, str, count, glyphs, 0 ); + GetGlyphIndicesW( ctx->hdc, str, count, glyphs, 0 ); str = glyphs; }
diff --git a/dlls/wineps.drv/type1.c b/dlls/wineps.drv/type1.c index 8501dc7aed8..1e69a513353 100644 --- a/dlls/wineps.drv/type1.c +++ b/dlls/wineps.drv/type1.c @@ -568,9 +568,9 @@ BOOL T1_download_glyph(print_ctx *ctx, DOWNLOAD *pdl, DWORD index, char *glyph_n outline.flags = NULL; outline.end_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); curpos.x = outline.lsb; diff --git a/dlls/wineps.drv/type42.c b/dlls/wineps.drv/type42.c index 60ff1101909..9e75d24eca4 100644 --- a/dlls/wineps.drv/type42.c +++ b/dlls/wineps.drv/type42.c @@ -175,7 +175,7 @@ TYPE42 *T42_download_header(print_ctx *ctx, char *ps_name, t42->num_of_written_tables = 0;
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].write) t42->num_of_written_tables++; 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, sg_index = GET_BE_WORD(sg_start + 2);
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); sg_start += 4; if(sg_flags & ARG_1_AND_2_ARE_WORDS)