gdi32: Use get_dc_attr in SetPolyFillMode.
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:
parent
22f7e39fb7
commit
84383245bb
|
@ -1392,34 +1392,6 @@ UINT WINAPI SetBoundsRect(HDC hdc, const RECT* rect, UINT flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* SetPolyFillMode (GDI32.@)
|
|
||||||
*/
|
|
||||||
INT WINAPI SetPolyFillMode( HDC hdc, INT mode )
|
|
||||||
{
|
|
||||||
INT ret = 0;
|
|
||||||
DC *dc;
|
|
||||||
|
|
||||||
if ((mode <= 0) || (mode > POLYFILL_LAST))
|
|
||||||
{
|
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if ((dc = get_dc_ptr( hdc )))
|
|
||||||
{
|
|
||||||
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetPolyFillMode );
|
|
||||||
mode = physdev->funcs->pSetPolyFillMode( physdev, mode );
|
|
||||||
if (mode)
|
|
||||||
{
|
|
||||||
ret = dc->attr->poly_fill_mode;
|
|
||||||
dc->attr->poly_fill_mode = mode;
|
|
||||||
}
|
|
||||||
release_dc_ptr( dc );
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* GetStretchBltMode (GDI32.@)
|
* GetStretchBltMode (GDI32.@)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -125,13 +125,13 @@ BOOL EMFDC_SetROP2( DC_ATTR *dc_attr, INT rop )
|
||||||
return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr );
|
return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr );
|
||||||
}
|
}
|
||||||
|
|
||||||
INT CDECL EMFDRV_SetPolyFillMode( PHYSDEV dev, INT mode )
|
BOOL EMFDC_SetPolyFillMode( DC_ATTR *dc_attr, INT mode )
|
||||||
{
|
{
|
||||||
EMRSETPOLYFILLMODE emr;
|
EMRSETPOLYFILLMODE emr;
|
||||||
emr.emr.iType = EMR_SETPOLYFILLMODE;
|
emr.emr.iType = EMR_SETPOLYFILLMODE;
|
||||||
emr.emr.nSize = sizeof(emr);
|
emr.emr.nSize = sizeof(emr);
|
||||||
emr.iMode = mode;
|
emr.iMode = mode;
|
||||||
return EMFDRV_WriteRecord( dev, &emr.emr ) ? mode : 0;
|
return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr );
|
||||||
}
|
}
|
||||||
|
|
||||||
INT CDECL EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode )
|
INT CDECL EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode )
|
||||||
|
|
|
@ -123,7 +123,6 @@ extern DWORD CDECL EMFDRV_SetLayout( PHYSDEV dev, DWORD layout ) DECLSPEC_HID
|
||||||
extern INT CDECL EMFDRV_SetMapMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
|
extern INT CDECL EMFDRV_SetMapMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
|
||||||
extern DWORD CDECL EMFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) DECLSPEC_HIDDEN;
|
extern DWORD CDECL EMFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) DECLSPEC_HIDDEN;
|
||||||
extern COLORREF CDECL EMFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
|
extern COLORREF CDECL EMFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
|
||||||
extern INT CDECL EMFDRV_SetPolyFillMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
|
|
||||||
extern INT CDECL EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
|
extern INT CDECL EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
|
||||||
extern COLORREF CDECL EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
|
extern COLORREF CDECL EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL CDECL EMFDRV_SetTextJustification( PHYSDEV dev, INT nBreakExtra, INT nBreakCount ) DECLSPEC_HIDDEN;
|
extern BOOL CDECL EMFDRV_SetTextJustification( PHYSDEV dev, INT nBreakExtra, INT nBreakCount ) DECLSPEC_HIDDEN;
|
||||||
|
|
|
@ -139,7 +139,7 @@ static const struct gdi_dc_funcs emfdrv_driver =
|
||||||
EMFDRV_SetMapMode, /* pSetMapMode */
|
EMFDRV_SetMapMode, /* pSetMapMode */
|
||||||
EMFDRV_SetMapperFlags, /* pSetMapperFlags */
|
EMFDRV_SetMapperFlags, /* pSetMapperFlags */
|
||||||
EMFDRV_SetPixel, /* pSetPixel */
|
EMFDRV_SetPixel, /* pSetPixel */
|
||||||
EMFDRV_SetPolyFillMode, /* pSetPolyFillMode */
|
NULL, /* pSetPolyFillMode */
|
||||||
NULL, /* pSetRelAbs */
|
NULL, /* pSetRelAbs */
|
||||||
EMFDRV_SetStretchBltMode, /* pSetStretchBltMode */
|
EMFDRV_SetStretchBltMode, /* pSetStretchBltMode */
|
||||||
NULL, /* pSetTextCharacterExtra */
|
NULL, /* pSetTextCharacterExtra */
|
||||||
|
|
|
@ -68,6 +68,7 @@ extern BOOL METADC_RoundRect( HDC hdc, 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 METADC_SetBkMode( HDC hdc, INT mode ) DECLSPEC_HIDDEN;
|
extern BOOL METADC_SetBkMode( HDC hdc, INT mode ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL METADC_SetPixel( HDC hdc, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
|
extern BOOL METADC_SetPixel( HDC hdc, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
|
||||||
|
extern BOOL METADC_SetPolyFillMode( HDC hdc, INT mode ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL METADC_SetRelAbs( HDC hdc, INT mode ) DECLSPEC_HIDDEN;
|
extern BOOL METADC_SetRelAbs( HDC hdc, INT mode ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL METADC_SetROP2( HDC hdc, INT rop ) DECLSPEC_HIDDEN;
|
extern BOOL METADC_SetROP2( HDC hdc, INT rop ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL METADC_SetTextAlign( HDC hdc, UINT align ) DECLSPEC_HIDDEN;
|
extern BOOL METADC_SetTextAlign( HDC hdc, UINT align ) DECLSPEC_HIDDEN;
|
||||||
|
@ -115,6 +116,7 @@ extern BOOL EMFDC_RoundRect( DC_ATTR *dc_attr, INT left, INT top, INT right, INT
|
||||||
extern BOOL EMFDC_SetArcDirection( DC_ATTR *dc_attr, INT dir ) 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_SetPolyFillMode( DC_ATTR *dc_attr, INT mode ) 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;
|
||||||
extern BOOL EMFDC_SetTextAlign( DC_ATTR *dc_attr, UINT align ) DECLSPEC_HIDDEN;
|
extern BOOL EMFDC_SetTextAlign( DC_ATTR *dc_attr, UINT align ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
|
|
|
@ -173,6 +173,29 @@ INT WINAPI GetPolyFillMode( HDC hdc )
|
||||||
return dc_attr ? dc_attr->poly_fill_mode : 0;
|
return dc_attr ? dc_attr->poly_fill_mode : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* SetPolyFillMode (GDI32.@)
|
||||||
|
*/
|
||||||
|
INT WINAPI SetPolyFillMode( HDC hdc, INT mode )
|
||||||
|
{
|
||||||
|
DC_ATTR *dc_attr;
|
||||||
|
INT ret;
|
||||||
|
|
||||||
|
if (mode <= 0 || mode > POLYFILL_LAST)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_meta_dc( hdc )) return METADC_SetPolyFillMode( hdc, mode );
|
||||||
|
if (!(dc_attr = get_dc_attr( hdc ))) return 0;
|
||||||
|
if (dc_attr->emf && !EMFDC_SetPolyFillMode( dc_attr, mode )) return 0;
|
||||||
|
|
||||||
|
ret = dc_attr->poly_fill_mode;
|
||||||
|
dc_attr->poly_fill_mode = mode;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* GetCurrentPositionEx (GDI32.@)
|
* GetCurrentPositionEx (GDI32.@)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -60,9 +60,9 @@ BOOL METADC_SetRelAbs( HDC hdc, INT mode )
|
||||||
return metadc_param1( hdc, META_SETRELABS, (WORD)mode );
|
return metadc_param1( hdc, META_SETRELABS, (WORD)mode );
|
||||||
}
|
}
|
||||||
|
|
||||||
INT CDECL MFDRV_SetPolyFillMode( PHYSDEV dev, INT mode )
|
BOOL METADC_SetPolyFillMode( HDC hdc, INT mode )
|
||||||
{
|
{
|
||||||
return MFDRV_MetaParam1( dev, META_SETPOLYFILLMODE, (WORD)mode) ? mode : 0;
|
return metadc_param1( hdc, META_SETPOLYFILLMODE, mode );
|
||||||
}
|
}
|
||||||
|
|
||||||
INT CDECL MFDRV_SetStretchBltMode( PHYSDEV dev, INT mode )
|
INT CDECL MFDRV_SetStretchBltMode( PHYSDEV dev, INT mode )
|
||||||
|
|
|
@ -202,7 +202,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
|
||||||
MFDRV_SetMapMode, /* pSetMapMode */
|
MFDRV_SetMapMode, /* pSetMapMode */
|
||||||
MFDRV_SetMapperFlags, /* pSetMapperFlags */
|
MFDRV_SetMapperFlags, /* pSetMapperFlags */
|
||||||
NULL, /* pSetPixel */
|
NULL, /* pSetPixel */
|
||||||
MFDRV_SetPolyFillMode, /* pSetPolyFillMode */
|
NULL, /* pSetPolyFillMode */
|
||||||
NULL, /* pSetRelAbs */
|
NULL, /* pSetRelAbs */
|
||||||
MFDRV_SetStretchBltMode, /* pSetStretchBltMode */
|
MFDRV_SetStretchBltMode, /* pSetStretchBltMode */
|
||||||
MFDRV_SetTextCharacterExtra, /* pSetTextCharacterExtra */
|
MFDRV_SetTextCharacterExtra, /* pSetTextCharacterExtra */
|
||||||
|
|
|
@ -111,7 +111,6 @@ extern COLORREF CDECL MFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPE
|
||||||
extern DWORD CDECL MFDRV_SetLayout( PHYSDEV dev, DWORD layout ) DECLSPEC_HIDDEN;
|
extern DWORD CDECL MFDRV_SetLayout( PHYSDEV dev, DWORD layout ) DECLSPEC_HIDDEN;
|
||||||
extern INT CDECL MFDRV_SetMapMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
|
extern INT CDECL MFDRV_SetMapMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
|
||||||
extern DWORD CDECL MFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) DECLSPEC_HIDDEN;
|
extern DWORD CDECL MFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) DECLSPEC_HIDDEN;
|
||||||
extern INT CDECL MFDRV_SetPolyFillMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
|
|
||||||
extern INT CDECL MFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
|
extern INT CDECL MFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN;
|
||||||
extern INT CDECL MFDRV_SetTextCharacterExtra( PHYSDEV dev, INT extra ) DECLSPEC_HIDDEN;
|
extern INT CDECL MFDRV_SetTextCharacterExtra( PHYSDEV dev, INT extra ) DECLSPEC_HIDDEN;
|
||||||
extern COLORREF CDECL MFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
|
extern COLORREF CDECL MFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
|
||||||
|
|
Loading…
Reference in New Issue