gdi32: Use get_dc_attr in SetArcDirection.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-07-29 13:21:56 +01:00 committed by Alexandre Julliard
parent ec8ce8c535
commit 18ce9d5efc
6 changed files with 27 additions and 34 deletions

View File

@ -990,35 +990,6 @@ INT WINAPI SetGraphicsMode( HDC hdc, INT mode )
} }
/***********************************************************************
* SetArcDirection (GDI32.@)
*/
INT WINAPI SetArcDirection( HDC hdc, INT dir )
{
DC * dc;
INT ret = 0;
if (dir != AD_COUNTERCLOCKWISE && dir != AD_CLOCKWISE)
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
if ((dc = get_dc_ptr( hdc )))
{
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetArcDirection );
dir = physdev->funcs->pSetArcDirection( physdev, dir );
if (dir)
{
ret = dc->attr->arc_direction;
dc->attr->arc_direction = dir;
}
release_dc_ptr( dc );
}
return ret;
}
/*********************************************************************** /***********************************************************************
* GetWorldTransform (GDI32.@) * GetWorldTransform (GDI32.@)
*/ */

View File

@ -143,14 +143,14 @@ INT CDECL EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode )
return EMFDRV_WriteRecord( dev, &emr.emr ) ? mode : 0; return EMFDRV_WriteRecord( dev, &emr.emr ) ? mode : 0;
} }
INT CDECL EMFDRV_SetArcDirection(PHYSDEV dev, INT arcDirection) BOOL EMFDC_SetArcDirection( DC_ATTR *dc_attr, INT dir )
{ {
EMRSETARCDIRECTION emr; EMRSETARCDIRECTION emr;
emr.emr.iType = EMR_SETARCDIRECTION; emr.emr.iType = EMR_SETARCDIRECTION;
emr.emr.nSize = sizeof(emr); emr.emr.nSize = sizeof(emr);
emr.iArcDirection = arcDirection; emr.iArcDirection = dir;
return EMFDRV_WriteRecord(dev, &emr.emr) ? arcDirection : 0; return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr );
} }
INT CDECL EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) INT CDECL EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom )

View File

@ -113,7 +113,6 @@ extern BOOL CDECL EMFDRV_SelectClipPath( PHYSDEV dev, INT iMode ) DECLSPEC_H
extern HFONT CDECL EMFDRV_SelectFont( PHYSDEV dev, HFONT handle, UINT *aa_flags ) DECLSPEC_HIDDEN; extern HFONT CDECL EMFDRV_SelectFont( PHYSDEV dev, HFONT handle, UINT *aa_flags ) DECLSPEC_HIDDEN;
extern HPEN CDECL EMFDRV_SelectPen( PHYSDEV dev, HPEN handle, const struct brush_pattern *pattern ) DECLSPEC_HIDDEN; extern HPEN CDECL EMFDRV_SelectPen( PHYSDEV dev, HPEN handle, const struct brush_pattern *pattern ) DECLSPEC_HIDDEN;
extern HPALETTE CDECL EMFDRV_SelectPalette( PHYSDEV dev, HPALETTE hPal, BOOL force ) DECLSPEC_HIDDEN; extern HPALETTE CDECL EMFDRV_SelectPalette( PHYSDEV dev, HPALETTE hPal, BOOL force ) DECLSPEC_HIDDEN;
extern INT CDECL EMFDRV_SetArcDirection( PHYSDEV dev, INT arcDirection ) DECLSPEC_HIDDEN;
extern COLORREF CDECL EMFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF CDECL EMFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF CDECL EMFDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF CDECL EMFDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF CDECL EMFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF CDECL EMFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;

View File

@ -127,7 +127,7 @@ static const struct gdi_dc_funcs emfdrv_driver =
EMFDRV_SelectFont, /* pSelectFont */ EMFDRV_SelectFont, /* pSelectFont */
EMFDRV_SelectPalette, /* pSelectPalette */ EMFDRV_SelectPalette, /* pSelectPalette */
EMFDRV_SelectPen, /* pSelectPen */ EMFDRV_SelectPen, /* pSelectPen */
EMFDRV_SetArcDirection, /* pSetArcDirection */ NULL, /* pSetArcDirection */
EMFDRV_SetBkColor, /* pSetBkColor */ EMFDRV_SetBkColor, /* pSetBkColor */
NULL, /* pSetBoundsRect */ NULL, /* pSetBoundsRect */
EMFDRV_SetDCBrushColor, /* pSetDCBrushColor*/ EMFDRV_SetDCBrushColor, /* pSetDCBrushColor*/

View File

@ -111,6 +111,7 @@ extern BOOL EMFDC_Rectangle( DC_ATTR *dc_attr, INT left, INT top, INT right,
INT bottom) DECLSPEC_HIDDEN; INT bottom) DECLSPEC_HIDDEN;
extern BOOL EMFDC_RoundRect( DC_ATTR *dc_attr, INT left, INT top, INT right, INT bottom, extern BOOL EMFDC_RoundRect( DC_ATTR *dc_attr, INT left, INT top, INT right, INT bottom,
INT ell_width, INT ell_height ) DECLSPEC_HIDDEN; INT ell_width, INT ell_height ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetArcDirection( DC_ATTR *dc_attr, INT dir ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetBkMode( DC_ATTR *dc_attr, INT mode ) DECLSPEC_HIDDEN; extern BOOL EMFDC_SetBkMode( DC_ATTR *dc_attr, INT mode ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetPixel( DC_ATTR *dc_attr, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN; extern BOOL EMFDC_SetPixel( DC_ATTR *dc_attr, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetROP2( DC_ATTR *dc_attr, INT rop ) DECLSPEC_HIDDEN; extern BOOL EMFDC_SetROP2( DC_ATTR *dc_attr, INT rop ) DECLSPEC_HIDDEN;

View File

@ -133,6 +133,28 @@ INT WINAPI GetArcDirection( HDC hdc )
return dc_attr ? dc_attr->arc_direction : 0; return dc_attr ? dc_attr->arc_direction : 0;
} }
/***********************************************************************
* SetArcDirection (GDI32.@)
*/
INT WINAPI SetArcDirection( HDC hdc, INT dir )
{
DC_ATTR *dc_attr;
INT ret;
if (dir != AD_COUNTERCLOCKWISE && dir != AD_CLOCKWISE)
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
if (!(dc_attr = get_dc_attr( hdc ))) return 0;
if (dc_attr->emf && !EMFDC_SetArcDirection( dc_attr, dir )) return 0;
ret = dc_attr->arc_direction;
dc_attr->arc_direction = dir;
return ret;
}
/*********************************************************************** /***********************************************************************
* GetLayout (GDI32.@) * GetLayout (GDI32.@)
*/ */