diff --git a/dlls/gdi/driver.c b/dlls/gdi/driver.c index c0cce852f56..45f2e4101bb 100644 --- a/dlls/gdi/driver.c +++ b/dlls/gdi/driver.c @@ -112,6 +112,7 @@ static struct graphics_driver *create_driver( HMODULE module ) GET_FUNC(InvertRgn); GET_FUNC(LineTo); GET_FUNC(MoveTo); + GET_FUNC(ModifyWorldTransform); GET_FUNC(OffsetClipRgn); GET_FUNC(OffsetViewportOrg); GET_FUNC(OffsetWindowOrg); @@ -166,6 +167,7 @@ static struct graphics_driver *create_driver( HMODULE module ) GET_FUNC(SetViewportOrg); GET_FUNC(SetWindowExt); GET_FUNC(SetWindowOrg); + GET_FUNC(SetWorldTransform); GET_FUNC(StartDoc); GET_FUNC(StartPage); GET_FUNC(StretchBlt); diff --git a/dlls/gdi/enhmfdrv/enhmetafiledrv.h b/dlls/gdi/enhmfdrv/enhmetafiledrv.h index 3868badf04b..b12fab0f290 100644 --- a/dlls/gdi/enhmfdrv/enhmetafiledrv.h +++ b/dlls/gdi/enhmfdrv/enhmetafiledrv.h @@ -83,6 +83,7 @@ extern INT EMFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT ri INT bottom ); extern BOOL EMFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ); extern BOOL EMFDRV_LineTo( PHYSDEV dev, INT x, INT y ); +extern BOOL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, INT mode ); extern BOOL EMFDRV_MoveTo( PHYSDEV dev, INT x, INT y ); extern INT EMFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ); extern INT EMFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y ); @@ -134,6 +135,7 @@ extern INT EMFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y ); extern INT EMFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y ); extern INT EMFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y ); extern INT EMFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y ); +extern BOOL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform ); extern BOOL EMFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst, INT heightDst, PHYSDEV devSrc, INT xSrc, INT ySrc, diff --git a/dlls/gdi/enhmfdrv/init.c b/dlls/gdi/enhmfdrv/init.c index 01d2ad24915..507c3d936c6 100644 --- a/dlls/gdi/enhmfdrv/init.c +++ b/dlls/gdi/enhmfdrv/init.c @@ -79,6 +79,7 @@ static const DC_FUNCTIONS EMFDRV_Funcs = EMFDRV_IntersectClipRect, /* pIntersectClipRect */ EMFDRV_InvertRgn, /* pInvertRgn */ EMFDRV_LineTo, /* pLineTo */ + EMFDRV_ModifyWorldTransform, /* pModifyWorldTransform */ EMFDRV_MoveTo, /* pMoveTo */ EMFDRV_OffsetClipRgn, /* pOffsetClipRgn */ NULL, /* pOffsetViewportOrg */ @@ -134,6 +135,7 @@ static const DC_FUNCTIONS EMFDRV_Funcs = EMFDRV_SetViewportOrg, /* pSetViewportOrg */ EMFDRV_SetWindowExt, /* pSetWindowExt */ EMFDRV_SetWindowOrg, /* pSetWindowOrg */ + EMFDRV_SetWorldTransform, /* pSetWorldTransform */ NULL, /* pStartDoc */ NULL, /* pStartPage */ NULL, /* pStretchBlt */ diff --git a/dlls/gdi/enhmfdrv/mapping.c b/dlls/gdi/enhmfdrv/mapping.c index 1d68b3224ee..310b7dc8fe7 100644 --- a/dlls/gdi/enhmfdrv/mapping.c +++ b/dlls/gdi/enhmfdrv/mapping.c @@ -107,3 +107,26 @@ INT EMFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, return EMFDRV_WriteRecord( dev, &emr.emr ); } + +BOOL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform) +{ + EMRSETWORLDTRANSFORM emr; + + emr.emr.iType = EMR_SETWORLDTRANSFORM; + emr.emr.nSize = sizeof(emr); + emr.xform = *xform; + + return EMFDRV_WriteRecord( dev, &emr.emr ); +} + +BOOL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, INT mode) +{ + EMRMODIFYWORLDTRANSFORM emr; + + emr.emr.iType = EMR_MODIFYWORLDTRANSFORM; + emr.emr.nSize = sizeof(emr); + emr.xform = *xform; + emr.iMode = mode; + + return EMFDRV_WriteRecord( dev, &emr.emr ); +} diff --git a/dlls/gdi/mfdrv/init.c b/dlls/gdi/mfdrv/init.c index 7c447c6ec8d..ca4d45f1363 100644 --- a/dlls/gdi/mfdrv/init.c +++ b/dlls/gdi/mfdrv/init.c @@ -80,6 +80,7 @@ static const DC_FUNCTIONS MFDRV_Funcs = MFDRV_IntersectClipRect, /* pIntersectClipRect */ MFDRV_InvertRgn, /* pInvertRgn */ MFDRV_LineTo, /* pLineTo */ + NULL, /* pModifyWorldTransform */ MFDRV_MoveTo, /* pMoveTo */ MFDRV_OffsetClipRgn, /* pOffsetClipRgn */ MFDRV_OffsetViewportOrg, /* pOffsetViewportOrg */ @@ -135,6 +136,7 @@ static const DC_FUNCTIONS MFDRV_Funcs = MFDRV_SetViewportOrg, /* pSetViewportOrg */ MFDRV_SetWindowExt, /* pSetWindowExt */ MFDRV_SetWindowOrg, /* pSetWindowOrg */ + NULL, /* pSetWorldTransform */ NULL, /* pStartDoc */ NULL, /* pStartPage */ MFDRV_StretchBlt, /* pStretchBlt */ diff --git a/include/gdi.h b/include/gdi.h index 82369195fc7..493da288e25 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -219,6 +219,7 @@ typedef struct tagDC_FUNCS INT (*pIntersectClipRect)(PHYSDEV,INT,INT,INT,INT); BOOL (*pInvertRgn)(PHYSDEV,HRGN); BOOL (*pLineTo)(PHYSDEV,INT,INT); + BOOL (*pModifyWorldTransform)(PHYSDEV,const XFORM*,INT); BOOL (*pMoveTo)(PHYSDEV,INT,INT); INT (*pOffsetClipRgn)(PHYSDEV,INT,INT); INT (*pOffsetViewportOrg)(PHYSDEV,INT,INT); @@ -275,6 +276,7 @@ typedef struct tagDC_FUNCS INT (*pSetViewportOrg)(PHYSDEV,INT,INT); INT (*pSetWindowExt)(PHYSDEV,INT,INT); INT (*pSetWindowOrg)(PHYSDEV,INT,INT); + BOOL (*pSetWorldTransform)(PHYSDEV,const XFORM*); INT (*pStartDoc)(PHYSDEV,const DOCINFOA*); INT (*pStartPage)(PHYSDEV); BOOL (*pStretchBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,INT,INT,DWORD); diff --git a/objects/dc.c b/objects/dc.c index 5de7839de3e..7e234bfca92 100644 --- a/objects/dc.c +++ b/objects/dc.c @@ -1014,6 +1014,12 @@ BOOL WINAPI SetWorldTransform( HDC hdc, const XFORM *xform ) /* Check that graphics mode is GM_ADVANCED */ if (dc->GraphicsMode!=GM_ADVANCED) goto done; + if (dc->funcs->pSetWorldTransform) + { + ret = dc->funcs->pSetWorldTransform(dc->physDev, xform); + if (!ret) goto done; + } + dc->xformWorld2Wnd = *xform; DC_UpdateXforms( dc ); ret = TRUE; @@ -1058,6 +1064,12 @@ BOOL WINAPI ModifyWorldTransform( HDC hdc, const XFORM *xform, /* Check that graphics mode is GM_ADVANCED */ if (dc->GraphicsMode!=GM_ADVANCED) goto done; + if (dc->funcs->pModifyWorldTransform) + { + ret = dc->funcs->pModifyWorldTransform(dc->physDev, xform, iMode); + if (!ret) goto done; + } + switch (iMode) { case MWT_IDENTITY: