From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Huw Davies huw@codeweavers.com --- dlls/gdi32/enhmfdrv/dc.c | 12 ++--------- dlls/gdi32/enhmfdrv/enhmetafiledrv.h | 1 - dlls/gdi32/enhmfdrv/init.c | 2 +- dlls/gdi32/gdi_private.h | 2 ++ dlls/gdi32/gdidc.c | 19 +++++++++++++++++ dlls/gdi32/mapping.c | 32 ---------------------------- dlls/gdi32/mfdrv/dc.c | 4 ++-- dlls/gdi32/mfdrv/init.c | 2 +- dlls/gdi32/mfdrv/metafiledrv.h | 1 - 9 files changed, 27 insertions(+), 48 deletions(-)
diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c index 5c4440afc17..9eae745a350 100644 --- a/dlls/gdi32/enhmfdrv/dc.c +++ b/dlls/gdi32/enhmfdrv/dc.c @@ -231,23 +231,15 @@ BOOL EMFDC_SetViewportExtEx( DC_ATTR *dc_attr, INT cx, INT cy ) return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr ); }
-BOOL CDECL EMFDRV_SetWindowExtEx( PHYSDEV dev, INT cx, INT cy, SIZE *size ) +BOOL EMFDC_SetWindowExtEx( DC_ATTR *dc_attr, INT cx, INT cy ) { - PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetWindowExtEx ); - EMFDRV_PDEVICE *physDev = get_emf_physdev( dev ); EMRSETWINDOWEXTEX emr; - BOOL ret;
emr.emr.iType = EMR_SETWINDOWEXTEX; emr.emr.nSize = sizeof(emr); emr.szlExtent.cx = cx; emr.szlExtent.cy = cy; - - if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE; - physDev->modifying_transform++; - ret = next->funcs->pSetWindowExtEx( next, cx, cy, size ); - physDev->modifying_transform--; - return ret; + return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr ); }
BOOL EMFDC_SetViewportOrgEx( DC_ATTR *dc_attr, INT x, INT y ) diff --git a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h index a5e310787a1..1ae6f17410e 100644 --- a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h +++ b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h @@ -110,7 +110,6 @@ extern INT CDECL EMFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDes BITMAPINFO *info, UINT coloruse ) DECLSPEC_HIDDEN; extern COLORREF CDECL EMFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF CDECL EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; -extern BOOL CDECL EMFDRV_SetWindowExtEx( PHYSDEV dev, INT x, INT y, SIZE *size ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_StretchBlt( PHYSDEV devDst, struct bitblt_coords *dst, diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c index c70af9f7cf5..e9746368aec 100644 --- a/dlls/gdi32/enhmfdrv/init.c +++ b/dlls/gdi32/enhmfdrv/init.c @@ -131,7 +131,7 @@ static const struct gdi_dc_funcs emfdrv_driver = EMFDRV_SetTextColor, /* pSetTextColor */ NULL, /* pSetViewportExtEx */ NULL, /* pSetViewportOrgEx */ - EMFDRV_SetWindowExtEx, /* pSetWindowExtEx */ + NULL, /* pSetWindowExtEx */ EMFDRV_SetWindowOrgEx, /* pSetWindowOrgEx */ EMFDRV_SetWorldTransform, /* pSetWorldTransform */ NULL, /* pStartDoc */ diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 5d6b308e85c..4fbb7a7571e 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -100,6 +100,7 @@ extern BOOL METADC_SetTextAlign( HDC hdc, UINT align ) DECLSPEC_HIDDEN; extern BOOL METADC_SetTextJustification( HDC hdc, INT extra, INT breaks ) DECLSPEC_HIDDEN; extern BOOL METADC_SetViewportExtEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL METADC_SetViewportOrgEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; +extern BOOL METADC_SetWindowExtEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
/* enhanced metafiles */ extern BOOL EMFDC_AbortPath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN; @@ -168,5 +169,6 @@ extern BOOL EMFDC_SetTextAlign( DC_ATTR *dc_attr, UINT align ) DECLSPEC_HIDDEN; extern BOOL EMFDC_SetTextJustification( DC_ATTR *dc_attr, INT extra, INT breaks ) DECLSPEC_HIDDEN; extern BOOL EMFDC_SetViewportExtEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL EMFDC_SetViewportOrgEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; +extern BOOL EMFDC_SetWindowExtEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
#endif /* __WINE_GDI_PRIVATE_H */ diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c index 026fde6a028..786edc8ffea 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -454,6 +454,25 @@ BOOL WINAPI GetWindowExtEx( HDC hdc, SIZE *size ) return TRUE; }
+/*********************************************************************** + * SetWindowExtEx (GDI32.@) + */ +BOOL WINAPI SetWindowExtEx( HDC hdc, INT x, INT y, SIZE *size ) +{ + DC_ATTR *dc_attr; + + if (is_meta_dc( hdc )) return METADC_SetWindowExtEx( hdc, x, y ); + if (!(dc_attr = get_dc_attr( hdc ))) return FALSE; + if (dc_attr->emf && !EMFDC_SetWindowExtEx( dc_attr, x, y )) return FALSE; + + if (size) *size = dc_attr->wnd_ext; + if (dc_attr->map_mode != MM_ISOTROPIC && dc_attr->map_mode != MM_ANISOTROPIC) return TRUE; + if (!x || !y) return FALSE; + dc_attr->wnd_ext.cx = x; + dc_attr->wnd_ext.cy = y; + return NtGdiComputeXformCoefficients( hdc ); +} + /*********************************************************************** * GetWindowOrgEx (GDI32.@) */ diff --git a/dlls/gdi32/mapping.c b/dlls/gdi32/mapping.c index 65e47f8e998..5947bd1b8ab 100644 --- a/dlls/gdi32/mapping.c +++ b/dlls/gdi32/mapping.c @@ -182,20 +182,6 @@ BOOL CDECL nulldrv_SetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
BOOL CDECL nulldrv_SetWindowExtEx( PHYSDEV dev, INT cx, INT cy, SIZE *size ) { - DC *dc = get_nulldrv_dc( dev ); - - if (size) - *size = dc->attr->wnd_ext; - - if (dc->attr->map_mode != MM_ISOTROPIC && dc->attr->map_mode != MM_ANISOTROPIC) return TRUE; - if (!cx || !cy) return FALSE; - dc->attr->wnd_ext.cx = cx; - dc->attr->wnd_ext.cy = cy; - /* The API docs say that you should call SetWindowExtEx before - SetViewportExtEx. This advice does not imply that Windows - doesn't ensure the isotropic mapping after SetWindowExtEx! */ - if (dc->attr->map_mode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc ); - DC_UpdateXforms( dc ); return TRUE; }
@@ -365,24 +351,6 @@ BOOL WINAPI NtGdiComputeXformCoefficients( HDC hdc ) }
-/*********************************************************************** - * SetWindowExtEx (GDI32.@) - */ -BOOL WINAPI SetWindowExtEx( HDC hdc, INT x, INT y, LPSIZE size ) -{ - BOOL ret = FALSE; - DC * dc = get_dc_ptr( hdc ); - - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetWindowExtEx ); - ret = physdev->funcs->pSetWindowExtEx( physdev, x, y, size ); - release_dc_ptr( dc ); - } - return ret; -} - - /*********************************************************************** * SetWindowOrgEx (GDI32.@) */ diff --git a/dlls/gdi32/mfdrv/dc.c b/dlls/gdi32/mfdrv/dc.c index 16184129b7d..eb5ad29e421 100644 --- a/dlls/gdi32/mfdrv/dc.c +++ b/dlls/gdi32/mfdrv/dc.c @@ -105,9 +105,9 @@ BOOL METADC_SetViewportOrgEx( HDC hdc, INT x, INT y ) return metadc_param2( hdc, META_SETVIEWPORTORG, x, y ); }
-BOOL CDECL MFDRV_SetWindowExtEx( PHYSDEV dev, INT x, INT y, SIZE *size ) +BOOL METADC_SetWindowExtEx( HDC hdc, INT x, INT y ) { - return MFDRV_MetaParam2( dev, META_SETWINDOWEXT, x, y ); + return metadc_param2( hdc, META_SETWINDOWEXT, x, y ); }
BOOL CDECL MFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index 959ea48c9e0..8a095246d21 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -196,7 +196,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs = MFDRV_SetTextColor, /* pSetTextColor */ NULL, /* pSetViewportExtEx */ NULL, /* pSetViewportOrgEx */ - MFDRV_SetWindowExtEx, /* pSetWindowExtEx */ + NULL, /* pSetWindowExtEx */ MFDRV_SetWindowOrgEx, /* pSetWindowOrgEx */ NULL, /* pSetWorldTransform */ NULL, /* pStartDoc */ diff --git a/dlls/gdi32/mfdrv/metafiledrv.h b/dlls/gdi32/mfdrv/metafiledrv.h index 4c9c5534597..4fb0093f956 100644 --- a/dlls/gdi32/mfdrv/metafiledrv.h +++ b/dlls/gdi32/mfdrv/metafiledrv.h @@ -99,7 +99,6 @@ extern COLORREF CDECL MFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_H extern COLORREF CDECL MFDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF CDECL MFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF CDECL MFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; -extern BOOL CDECL MFDRV_SetWindowExtEx( PHYSDEV dev, INT x, INT y, SIZE *size ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_StretchBlt( PHYSDEV devDst, struct bitblt_coords *dst, PHYSDEV devSrc, struct bitblt_coords *src, DWORD rop ) DECLSPEC_HIDDEN;