gdi32: Use DC_ATTR for SetTextCharacterExtra implementation.

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-08-05 11:26:28 +02:00 committed by Alexandre Julliard
parent ca07de0ed5
commit f37e4ff931
6 changed files with 19 additions and 27 deletions

View File

@ -4735,29 +4735,6 @@ INT WINAPI EnumFontsW( HDC hDC, LPCWSTR lpName, FONTENUMPROCW efproc,
}
/***********************************************************************
* SetTextCharacterExtra (GDI32.@)
*/
INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra )
{
INT ret = 0x80000000;
DC * dc = get_dc_ptr( hdc );
if (dc)
{
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetTextCharacterExtra );
extra = physdev->funcs->pSetTextCharacterExtra( physdev, extra );
if (extra != 0x80000000)
{
ret = dc->attr->char_extra;
dc->attr->char_extra = extra;
}
release_dc_ptr( dc );
}
return ret;
}
/***********************************************************************
* NtGdiSetTextJustification (win32u.@)
*/

View File

@ -76,6 +76,7 @@ extern BOOL METADC_RoundRect( HDC hdc, INT left, INT top, INT right, INT bottom,
INT ell_width, INT ell_height ) DECLSPEC_HIDDEN;
extern BOOL METADC_SaveDC( HDC hdc ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetBkMode( HDC hdc, INT mode ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetTextCharacterExtra( HDC hdc, INT extra ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetMapMode( HDC hdc, INT mode ) 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;

View File

@ -314,6 +314,21 @@ INT WINAPI GetTextCharacterExtra( HDC hdc )
return dc_attr ? dc_attr->char_extra : 0x80000000;
}
/***********************************************************************
* SetTextCharacterExtra (GDI32.@)
*/
INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra )
{
DC_ATTR *dc_attr;
INT ret;
if (is_meta_dc( hdc )) return METADC_SetTextCharacterExtra( hdc, extra );
if (!(dc_attr = get_dc_attr( hdc ))) return 0x8000000;
ret = dc_attr->char_extra;
dc_attr->char_extra = extra;
return ret;
}
/***********************************************************************
* GetPolyFillMode (GDI32.@)
*/

View File

@ -140,9 +140,9 @@ BOOL METADC_SetTextJustification( HDC hdc, INT extra, INT breaks )
return metadc_param2( hdc, META_SETTEXTJUSTIFICATION, extra, breaks );
}
INT CDECL MFDRV_SetTextCharacterExtra( PHYSDEV dev, INT extra )
BOOL METADC_SetTextCharacterExtra( HDC hdc, INT extra )
{
return MFDRV_MetaParam1( dev, META_SETTEXTCHAREXTRA, extra ) ? extra : 0x80000000;
return metadc_param1( hdc, META_SETTEXTCHAREXTRA, extra );
}
DWORD CDECL MFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags )

View File

@ -198,7 +198,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
NULL, /* pSetMapMode */
MFDRV_SetMapperFlags, /* pSetMapperFlags */
NULL, /* pSetPixel */
MFDRV_SetTextCharacterExtra, /* pSetTextCharacterExtra */
NULL, /* pSetTextCharacterExtra */
MFDRV_SetTextColor, /* pSetTextColor */
NULL, /* pSetTextJustification */
MFDRV_SetViewportExtEx, /* pSetViewportExtEx */

View File

@ -105,7 +105,6 @@ extern COLORREF CDECL MFDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLS
extern COLORREF CDECL MFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern DWORD CDECL MFDRV_SetLayout( PHYSDEV dev, DWORD layout ) DECLSPEC_HIDDEN;
extern DWORD CDECL MFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) 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 BOOL CDECL MFDRV_SetViewportExtEx( PHYSDEV dev, INT x, INT y, SIZE *size ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_SetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;