From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/gdi32/dc.c | 1 + dlls/gdi32/emfdc.c | 10 ++++++++++ dlls/gdi32/gdi_private.h | 1 + 3 files changed, 12 insertions(+)
diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index 02c6a8c84cd..21005fa0719 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -1060,6 +1060,7 @@ BOOL WINAPI SetBrushOrgEx( HDC hdc, INT x, INT y, POINT *oldorg ) { DC_ATTR *dc_attr; if (!(dc_attr = get_dc_attr( hdc ))) return FALSE; + if (dc_attr->emf && !EMFDC_SetBrushOrgEx( dc_attr, x, y )) return FALSE; if (oldorg) *oldorg = dc_attr->brush_org; dc_attr->brush_org.x = x; dc_attr->brush_org.y = y; diff --git a/dlls/gdi32/emfdc.c b/dlls/gdi32/emfdc.c index e94f3c69b12..231b4ae217d 100644 --- a/dlls/gdi32/emfdc.c +++ b/dlls/gdi32/emfdc.c @@ -2129,6 +2129,16 @@ BOOL EMFDC_SetBkColor( DC_ATTR *dc_attr, COLORREF color ) return emfdc_record( get_dc_emf( dc_attr ), &emr.emr ); }
+BOOL EMFDC_SetBrushOrgEx( DC_ATTR *dc_attr, INT x, INT y ) +{ + EMRSETBRUSHORGEX emr; + + emr.emr.iType = EMR_SETBRUSHORGEX; + emr.emr.nSize = sizeof(emr); + emr.ptlOrigin.x = x; + emr.ptlOrigin.y = y; + return emfdc_record( get_dc_emf( dc_attr ), &emr.emr ); +}
BOOL EMFDC_SetTextColor( DC_ATTR *dc_attr, COLORREF color ) { diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index d9bf1c32895..8fa5c06e014 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -233,6 +233,7 @@ BOOL EMFDC_SelectPalette( DC_ATTR *dc_attr, HPALETTE palette ); BOOL EMFDC_SetArcDirection( DC_ATTR *dc_attr, INT dir ); BOOL EMFDC_SetBkColor( DC_ATTR *dc_attr, COLORREF color ); BOOL EMFDC_SetBkMode( DC_ATTR *dc_attr, INT mode ); +BOOL EMFDC_SetBrushOrgEx( DC_ATTR *dc_attr, INT x, INT y ); BOOL EMFDC_SetDCBrushColor( DC_ATTR *dc_attr, COLORREF color ); BOOL EMFDC_SetDCPenColor( DC_ATTR *dc_attr, COLORREF color ); INT EMFDC_SetDIBitsToDevice( DC_ATTR *dc_attr, INT x_dest, INT y_dest, DWORD width, DWORD height,
From: Nikolay Sivov nsivov@codeweavers.com
It appears to be a stub on modern systems. Does not generate EMF output either.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/gdi32/tests/brush.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/tests/brush.c b/dlls/gdi32/tests/brush.c index b23e73ac65f..8df3c48a20d 100644 --- a/dlls/gdi32/tests/brush.c +++ b/dlls/gdi32/tests/brush.c @@ -411,16 +411,36 @@ static void test_brush_org( void ) { HDC hdc = GetDC( 0 ); POINT old, pt; + BOOL ret;
- SetBrushOrgEx( hdc, 0, 0, &old ); + ret = SetBrushOrgEx( hdc, 0, 0, &old ); + ok(ret, "Unexpected return value %d.\n", ret);
- SetBrushOrgEx( hdc, 1, 1, &pt ); + ret = SetBrushOrgEx( hdc, 1, 1, &pt ); + ok(ret, "Unexpected return value %d.\n", ret); ok( pt.x == 0 && pt.y == 0, "got %ld,%ld\n", pt.x, pt.y ); - SetBrushOrgEx( hdc, 0x10000, -1, &pt ); + ret = SetBrushOrgEx( hdc, 0x10000, -1, &pt ); + ok(ret, "Unexpected return value %d.\n", ret); ok( pt.x == 1 && pt.y == 1, "got %ld,%ld\n", pt.x, pt.y ); - SetBrushOrgEx( hdc, old.x, old.y, &pt ); + ret = SetBrushOrgEx( hdc, old.x, old.y, &pt ); + ok(ret, "Unexpected return value %d.\n", ret); ok( pt.x == 0x10000 && pt.y == -1, "got %ld,%ld\n", pt.x, pt.y );
+ ret = GetBrushOrgEx( hdc, &pt ); + ok(ret, "Unexpected return value %d.\n", ret); + ok( pt.x == 0 && pt.y == 0, "got %ld,%ld\n", pt.x, pt.y ); + pt.x = 10; + pt.y = 20; + ret = FixBrushOrgEx( hdc, 2, 3, &pt ); + todo_wine + ok(!ret, "Unexpected return value %d.\n", ret); + todo_wine + ok( pt.x == 10 && pt.y == 20, "got %ld,%ld\n", pt.x, pt.y ); + ret = GetBrushOrgEx( hdc, &pt ); + ok(ret, "Unexpected return value %d.\n", ret); + todo_wine + ok( pt.x == 0 && pt.y == 0, "got %ld,%ld\n", pt.x, pt.y ); + ReleaseDC( 0, hdc ); }
This merge request was approved by Huw Davies.