gdi32: Use NtGdiGetCharABCWidthsW for GetCharABCWidthsW.

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-27 13:51:48 +01:00 committed by Alexandre Julliard
parent 731dca90c7
commit b656ff5d75
3 changed files with 19 additions and 10 deletions

View file

@ -5648,7 +5648,7 @@ BOOL WINAPI GetCharABCWidthsA(HDC hdc, UINT firstChar, UINT lastChar,
/******************************************************************************
* GetCharABCWidthsW [GDI32.@]
* NtGdiGetCharABCWidthsW (win32u.@)
*
* Retrieves widths of characters in range.
*
@ -5660,13 +5660,9 @@ BOOL WINAPI GetCharABCWidthsA(HDC hdc, UINT firstChar, UINT lastChar,
*
* NOTES
* Only works with TrueType fonts
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/
BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar,
LPABC abc )
BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar, WCHAR *chars,
ULONG flags, void *buffer )
{
DC *dc = get_dc_ptr(hdc);
PHYSDEV dev;
@ -5676,7 +5672,7 @@ BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar,
if (!dc) return FALSE;
if (!abc)
if (!buffer)
{
release_dc_ptr( dc );
return FALSE;
@ -5691,9 +5687,10 @@ BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar,
}
dev = GET_DC_PHYSDEV( dc, pGetCharABCWidths );
ret = dev->funcs->pGetCharABCWidths( dev, firstChar, lastChar, abc );
ret = dev->funcs->pGetCharABCWidths( dev, firstChar, lastChar, buffer );
if (ret)
{
ABC *abc = buffer;
/* convert device units to logical */
for( i = firstChar; i <= lastChar; i++, abc++ ) {
abc->abcA = width_to_LP(dc, abc->abcA);

View file

@ -1682,3 +1682,11 @@ BOOL WINAPI GetCharWidthI( HDC hdc, UINT first, UINT count, WORD *glyphs, INT *b
return NtGdiGetCharWidthW( hdc, first, count, glyphs,
NTGDI_GETCHARWIDTH_INT | NTGDI_GETCHARWIDTH_INDICES, buffer );
}
/***********************************************************************
* GetCharABCWidthsW (GDI32.@)
*/
BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT first, UINT last, ABC *abc )
{
return NtGdiGetCharABCWidthsW( hdc, first, last, NULL, NTGDI_GETCHARABCWIDTHS_INT, abc );
}

View file

@ -126,6 +126,9 @@ enum
#define NTGDI_GETCHARWIDTH_INT 0x02
#define NTGDI_GETCHARWIDTH_INDICES 0x08
#define NTGDI_GETCHARABCWIDTHS_INT 0x01
#define NTGDI_GETCHARABCWIDTHS_INDICES 0x02
#define MWT_SET 4
/* structs not compatible with native Windows */
@ -229,7 +232,8 @@ BOOL WINAPI NtGdiGetAndSetDCDword( HDC hdc, UINT method, DWORD value, DWORD
INT WINAPI NtGdiGetAppClipBox( HDC hdc, RECT *rect );
BOOL WINAPI NtGdiGetBitmapDimension( HBITMAP bitmap, SIZE *size );
UINT WINAPI NtGdiGetBoundsRect( HDC hdc, RECT *rect, UINT flags );
BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT first_char, UINT last_char, ABC *abc );
BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT first, UINT last, WCHAR *chars,
ULONG flags, void *buffer );
BOOL WINAPI NtGdiGetCharWidthW( HDC hdc, UINT first_char, UINT last_char, WCHAR *chars,
ULONG flags, void *buffer );
BOOL WINAPI NtGdiGetDCDword( HDC hdc, UINT method, DWORD *result );