Commit 18ce9d5e authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Use get_dc_attr in SetArcDirection.

parent ec8ce8c5
......@@ -991,35 +991,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.@)
*/
BOOL WINAPI GetWorldTransform( HDC hdc, LPXFORM xform )
......
......@@ -143,14 +143,14 @@ INT CDECL EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode )
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;
emr.emr.iType = EMR_SETARCDIRECTION;
emr.emr.nSize = sizeof(emr);
emr.iArcDirection = arcDirection;
return EMFDRV_WriteRecord(dev, &emr.emr) ? arcDirection : 0;
emr.iArcDirection = dir;
return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr );
}
INT CDECL EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
......
......@@ -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 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 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_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF CDECL EMFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
......
......@@ -127,7 +127,7 @@ static const struct gdi_dc_funcs emfdrv_driver =
EMFDRV_SelectFont, /* pSelectFont */
EMFDRV_SelectPalette, /* pSelectPalette */
EMFDRV_SelectPen, /* pSelectPen */
EMFDRV_SetArcDirection, /* pSetArcDirection */
NULL, /* pSetArcDirection */
EMFDRV_SetBkColor, /* pSetBkColor */
NULL, /* pSetBoundsRect */
EMFDRV_SetDCBrushColor, /* pSetDCBrushColor*/
......
......@@ -111,6 +111,7 @@ extern BOOL EMFDC_Rectangle( DC_ATTR *dc_attr, INT left, INT top, INT right,
INT bottom) DECLSPEC_HIDDEN;
extern BOOL EMFDC_RoundRect( DC_ATTR *dc_attr, INT left, INT top, INT right, INT bottom,
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_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;
......
......@@ -134,6 +134,28 @@ INT WINAPI GetArcDirection( HDC hdc )
}
/***********************************************************************
* 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.@)
*/
DWORD WINAPI GetLayout( HDC hdc )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment