From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 399e8a8c212..20a1ca11aef 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -735,6 +735,13 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, return 1; } } + case EMR_DELETEOBJECT: + { + const EMRDELETEOBJECT *p = (const EMRDELETEOBJECT *)rec; + + memset(&data->patterns[p->ihObject], 0, sizeof(*data->patterns)); + return PlayEnhMetaFileRecord(data->pdev->dev.hdc, htable, rec, n); + } case EMR_ANGLEARC: { const EMRANGLEARC *p = (const EMRANGLEARC *)rec;
From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 76 +++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 20a1ca11aef..79d02c9f170 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -624,6 +624,74 @@ static int plg_blt(PHYSDEV dev, const EMRPLGBLT *p) return TRUE; }
+static int poly_draw(PHYSDEV dev, const POINT *points, const BYTE *types, DWORD count) +{ + POINT first, cur, pts[4]; + DWORD i, num_pts; + + /* check for valid point types */ + for (i = 0; i < count; i++) + { + switch (types[i]) + { + case PT_MOVETO: + case PT_LINETO | PT_CLOSEFIGURE: + case PT_LINETO: + break; + case PT_BEZIERTO: + if (i + 2 >= count) return FALSE; + if (types[i + 1] != PT_BEZIERTO) return FALSE; + if ((types[i + 2] & ~PT_CLOSEFIGURE) != PT_BEZIERTO) return FALSE; + i += 2; + break; + default: + return FALSE; + } + } + + GetCurrentPositionEx(dev->hdc, &cur); + first = cur; + + for (i = 0; i < count; i++) + { + switch (types[i]) + { + case PT_MOVETO: + first = points[i]; + break; + case PT_LINETO: + case (PT_LINETO | PT_CLOSEFIGURE): + pts[0] = cur; + pts[1] = points[i]; + num_pts = 2; + if (!PSDRV_PolyPolyline(dev, pts, &num_pts, 1)) + return FALSE; + break; + case PT_BEZIERTO: + pts[0] = cur; + pts[1] = points[i]; + pts[2] = points[i + 1]; + pts[3] = points[i + 2]; + if (!PSDRV_PolyBezier(dev, pts, 4)) + return FALSE; + i += 2; + break; + } + + cur = points[i]; + if (types[i] & PT_CLOSEFIGURE) + { + pts[0] = cur; + pts[1] = first; + num_pts = 2; + if (!PSDRV_PolyPolyline(dev, pts, &num_pts, 1)) + return FALSE; + } + } + + return TRUE; +} + static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, const ENHMETARECORD *rec, int n, LPARAM arg) { @@ -850,6 +918,14 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, } return ret; } + case EMR_POLYDRAW: + { + const EMRPOLYDRAW *p = (const EMRPOLYDRAW *)rec; + const POINT *pts = (const POINT *)p->aptl; + + return poly_draw(&data->pdev->dev, pts, (BYTE *)(p->aptl + p->cptl), p->cptl) && + MoveToEx(data->pdev->dev.hdc, pts[p->cptl - 1].x, pts[p->cptl - 1].y, NULL); + } case EMR_PAINTRGN: { const EMRPAINTRGN *p = (const EMRPAINTRGN *)rec;
From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 79d02c9f170..30dd6f16e28 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -1112,6 +1112,24 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, free(pts); return i; } + case EMR_POLYDRAW16: + { + const EMRPOLYDRAW16 *p = (const EMRPOLYDRAW16 *)rec; + POINT *pts; + int i; + + pts = malloc(sizeof(*pts) * p->cpts); + if (!pts) return 0; + for (i = 0; i < p->cpts; i++) + { + pts[i].x = p->apts[i].x; + pts[i].y = p->apts[i].y; + } + i = poly_draw(&data->pdev->dev, pts, (BYTE *)(p->apts + p->cpts), p->cpts) && + MoveToEx(data->pdev->dev.hdc, pts[p->cpts - 1].x, pts[p->cpts - 1].y, NULL); + free(pts); + return i; + } case EMR_CREATEMONOBRUSH: { const EMRCREATEMONOBRUSH *p = (const EMRCREATEMONOBRUSH *)rec;
From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 30dd6f16e28..af3b18df1bc 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -1161,6 +1161,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, case EMR_MOVETOEX: case EMR_SETWORLDTRANSFORM: case EMR_MODIFYWORLDTRANSFORM: + case EMR_CREATEPEN: case EMR_SETARCDIRECTION: return PlayEnhMetaFileRecord(data->pdev->dev.hdc, htable, rec, n); default:
From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index af3b18df1bc..4e90347a4eb 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -1162,6 +1162,7 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, case EMR_SETWORLDTRANSFORM: case EMR_MODIFYWORLDTRANSFORM: case EMR_CREATEPEN: + case EMR_CREATEBRUSHINDIRECT: case EMR_SETARCDIRECTION: return PlayEnhMetaFileRecord(data->pdev->dev.hdc, htable, rec, n); default:
This merge request was approved by Huw Davies.