From 36a6c740c41673164fb29cc39e44d72e2890a19d Mon Sep 17 00:00:00 2001 From: Dave Belanger Date: Thu, 9 Oct 2003 04:42:45 +0000 Subject: [PATCH] Implementation of EMF driver OffsetViewportOrg and OffsetWindowOrg callbacks using the EMR_SETVIEWPORTORGEX and EMR_SETWINDOWORGEX metarecords respectively. --- dlls/gdi/enhmfdrv/init.c | 4 ++-- dlls/gdi/enhmfdrv/mapping.c | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/dlls/gdi/enhmfdrv/init.c b/dlls/gdi/enhmfdrv/init.c index 9ce54607c80..6385ea8fed3 100644 --- a/dlls/gdi/enhmfdrv/init.c +++ b/dlls/gdi/enhmfdrv/init.c @@ -84,8 +84,8 @@ static const DC_FUNCTIONS EMFDRV_Funcs = EMFDRV_ModifyWorldTransform, /* pModifyWorldTransform */ EMFDRV_MoveTo, /* pMoveTo */ EMFDRV_OffsetClipRgn, /* pOffsetClipRgn */ - NULL, /* pOffsetViewportOrg */ - NULL, /* pOffsetWindowOrg */ + EMFDRV_OffsetViewportOrg, /* pOffsetViewportOrg */ + EMFDRV_OffsetWindowOrg, /* pOffsetWindowOrg */ EMFDRV_PaintRgn, /* pPaintRgn */ EMFDRV_PatBlt, /* pPatBlt */ EMFDRV_Pie, /* pPie */ diff --git a/dlls/gdi/enhmfdrv/mapping.c b/dlls/gdi/enhmfdrv/mapping.c index 310b7dc8fe7..443900b814a 100644 --- a/dlls/gdi/enhmfdrv/mapping.c +++ b/dlls/gdi/enhmfdrv/mapping.c @@ -130,3 +130,29 @@ BOOL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, INT mode) return EMFDRV_WriteRecord( dev, &emr.emr ); } + +INT EMFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y ) +{ + EMRSETVIEWPORTORGEX emr; + EMFDRV_PDEVICE* physDev = (EMFDRV_PDEVICE*)dev; + + emr.emr.iType = EMR_SETVIEWPORTORGEX; + emr.emr.nSize = sizeof(emr); + emr.ptlOrigin.x = physDev->dc->vportOrgX + x; + emr.ptlOrigin.y = physDev->dc->vportOrgY + y; + + return EMFDRV_WriteRecord( dev, &emr.emr ); +} + +INT EMFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y ) +{ + EMRSETWINDOWORGEX emr; + EMFDRV_PDEVICE* physDev = (EMFDRV_PDEVICE*)dev; + + emr.emr.iType = EMR_SETWINDOWORGEX; + emr.emr.nSize = sizeof(emr); + emr.ptlOrigin.x = physDev->dc->wndOrgX + x; + emr.ptlOrigin.y = physDev->dc->wndOrgY + y; + + return EMFDRV_WriteRecord( dev, &emr.emr ); +} -- 2.11.4.GIT