gdi32: Added GetFontRealizationInfo() export.

This commit is contained in:
Nikolay Sivov 2015-08-29 19:54:17 +03:00 committed by Alexandre Julliard
parent adb0f582e0
commit 7889b17425
15 changed files with 77 additions and 34 deletions

View File

@ -429,7 +429,6 @@ const struct gdi_dc_funcs dib_driver =
NULL, /* pFontIsLinked */
NULL, /* pFrameRgn */
NULL, /* pGdiComment */
NULL, /* pGdiRealizationInfo */
NULL, /* pGetBoundsRect */
NULL, /* pGetCharABCWidths */
NULL, /* pGetCharABCWidthsI */
@ -437,6 +436,7 @@ const struct gdi_dc_funcs dib_driver =
NULL, /* pGetDeviceCaps */
NULL, /* pGetDeviceGammaRamp */
NULL, /* pGetFontData */
NULL, /* pGetFontRealizationInfo */
NULL, /* pGetFontUnicodeRanges */
NULL, /* pGetGlyphIndices */
NULL, /* pGetGlyphOutline */
@ -1049,7 +1049,6 @@ static const struct gdi_dc_funcs window_driver =
NULL, /* pFontIsLinked */
NULL, /* pFrameRgn */
NULL, /* pGdiComment */
NULL, /* pGdiRealizationInfo */
NULL, /* pGetBoundsRect */
NULL, /* pGetCharABCWidths */
NULL, /* pGetCharABCWidthsI */
@ -1057,6 +1056,7 @@ static const struct gdi_dc_funcs window_driver =
NULL, /* pGetDeviceCaps */
NULL, /* pGetDeviceGammaRamp */
NULL, /* pGetFontData */
NULL, /* pGetFontRealizationInfo */
NULL, /* pGetFontUnicodeRanges */
NULL, /* pGetGlyphIndices */
NULL, /* pGetGlyphOutline */

View File

@ -276,11 +276,6 @@ static BOOL nulldrv_GdiComment( PHYSDEV dev, UINT size, const BYTE *data )
return FALSE;
}
static BOOL nulldrv_GdiRealizationInfo( PHYSDEV dev, void *info )
{
return FALSE;
}
static UINT nulldrv_GetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags )
{
return DCB_RESET;
@ -334,6 +329,11 @@ static DWORD nulldrv_GetFontData( PHYSDEV dev, DWORD table, DWORD offset, LPVOID
return FALSE;
}
static BOOL nulldrv_GetFontRealizationInfo( PHYSDEV dev, void *info )
{
return FALSE;
}
static DWORD nulldrv_GetFontUnicodeRanges( PHYSDEV dev, LPGLYPHSET glyphs )
{
return 0;
@ -668,7 +668,6 @@ const struct gdi_dc_funcs null_driver =
nulldrv_FontIsLinked, /* pFontIsLinked */
nulldrv_FrameRgn, /* pFrameRgn */
nulldrv_GdiComment, /* pGdiComment */
nulldrv_GdiRealizationInfo, /* pGdiRealizationInfo */
nulldrv_GetBoundsRect, /* pGetBoundsRect */
nulldrv_GetCharABCWidths, /* pGetCharABCWidths */
nulldrv_GetCharABCWidthsI, /* pGetCharABCWidthsI */
@ -676,6 +675,7 @@ const struct gdi_dc_funcs null_driver =
nulldrv_GetDeviceCaps, /* pGetDeviceCaps */
nulldrv_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */
nulldrv_GetFontData, /* pGetFontData */
nulldrv_GetFontRealizationInfo, /* pGetFontRealizationInfo */
nulldrv_GetFontUnicodeRanges, /* pGetFontUnicodeRanges */
nulldrv_GetGlyphIndices, /* pGetGlyphIndices */
nulldrv_GetGlyphOutline, /* pGetGlyphOutline */

View File

@ -69,7 +69,6 @@ static const struct gdi_dc_funcs EMFDRV_Funcs =
NULL, /* pFontIsLinked */
EMFDRV_FrameRgn, /* pFrameRgn */
EMFDRV_GdiComment, /* pGdiComment */
NULL, /* pGdiRealizationInfo */
NULL, /* pGetBoundsRect */
NULL, /* pGetCharABCWidths */
NULL, /* pGetCharABCWidthsI */
@ -77,6 +76,7 @@ static const struct gdi_dc_funcs EMFDRV_Funcs =
EMFDRV_GetDeviceCaps, /* pGetDeviceCaps */
NULL, /* pGetDeviceGammaRamp */
NULL, /* pGetFontData */
NULL, /* pGetFontRealizationInfo */
NULL, /* pGetFontUnicodeRanges */
NULL, /* pGetGlyphIndices */
NULL, /* pGetGlyphOutline */

View File

@ -3845,20 +3845,52 @@ BOOL WINAPI FontIsLinked(HDC hdc)
return ret;
}
/*************************************************************
* GetFontRealizationInfo (GDI32.@)
*/
BOOL WINAPI GetFontRealizationInfo(HDC hdc, struct font_realization_info *info)
{
BOOL is_v0 = info->size == FIELD_OFFSET(struct font_realization_info, unk);
PHYSDEV dev;
BOOL ret;
DC *dc;
if (info->size != sizeof(*info) && !is_v0)
return FALSE;
dc = get_dc_ptr(hdc);
if (!dc) return FALSE;
dev = GET_DC_PHYSDEV( dc, pGetFontRealizationInfo );
ret = dev->funcs->pGetFontRealizationInfo( dev, info );
release_dc_ptr(dc);
return ret;
}
struct realization_info
{
DWORD flags; /* 1 for bitmap fonts, 3 for scalable fonts */
DWORD cache_num; /* keeps incrementing - num of fonts that have been created allowing for caching?? */
DWORD instance_id; /* identifies a realized font instance */
};
/*************************************************************
* GdiRealizationInfo (GDI32.@)
*
* Returns a structure that contains some font information.
*/
BOOL WINAPI GdiRealizationInfo(HDC hdc, realization_info_t *info)
BOOL WINAPI GdiRealizationInfo(HDC hdc, struct realization_info *info)
{
DC *dc = get_dc_ptr(hdc);
PHYSDEV dev;
struct font_realization_info ri;
BOOL ret;
if (!dc) return FALSE;
dev = GET_DC_PHYSDEV( dc, pGdiRealizationInfo );
ret = dev->funcs->pGdiRealizationInfo( dev, info );
release_dc_ptr(dc);
ri.size = sizeof(ri);
ret = GetFontRealizationInfo( hdc, &ri );
if (ret)
{
info->flags = ri.flags;
info->cache_num = ri.cache_num;
info->instance_id = ri.instance_id;
}
return ret;
}

View File

@ -8131,17 +8131,17 @@ BOOL WINAPI GetRasterizerCaps( LPRASTERIZER_STATUS lprs, UINT cbNumBytes)
}
/*************************************************************
* freetype_GdiRealizationInfo
* freetype_GetFontRealizationInfo
*/
static BOOL freetype_GdiRealizationInfo( PHYSDEV dev, void *ptr )
static BOOL freetype_GetFontRealizationInfo( PHYSDEV dev, void *ptr )
{
struct freetype_physdev *physdev = get_freetype_dev( dev );
realization_info_t *info = ptr;
struct font_realization_info *info = ptr;
if (!physdev->font)
{
dev = GET_NEXT_PHYSDEV( dev, pGdiRealizationInfo );
return dev->funcs->pGdiRealizationInfo( dev, ptr );
dev = GET_NEXT_PHYSDEV( dev, pGetFontRealizationInfo );
return dev->funcs->pGetFontRealizationInfo( dev, ptr );
}
FIXME("(%p, %p): stub!\n", physdev->font, info);
@ -8152,6 +8152,12 @@ static BOOL freetype_GdiRealizationInfo( PHYSDEV dev, void *ptr )
info->cache_num = physdev->font->cache_num;
info->instance_id = -1;
if (info->size == sizeof(*info))
{
info->unk = 0;
info->face_index = physdev->font->ft_face->face_index;
}
return TRUE;
}
@ -8445,7 +8451,6 @@ static const struct gdi_dc_funcs freetype_funcs =
freetype_FontIsLinked, /* pFontIsLinked */
NULL, /* pFrameRgn */
NULL, /* pGdiComment */
freetype_GdiRealizationInfo, /* pGdiRealizationInfo */
NULL, /* pGetBoundsRect */
freetype_GetCharABCWidths, /* pGetCharABCWidths */
freetype_GetCharABCWidthsI, /* pGetCharABCWidthsI */
@ -8453,6 +8458,7 @@ static const struct gdi_dc_funcs freetype_funcs =
NULL, /* pGetDeviceCaps */
NULL, /* pGetDeviceGammaRamp */
freetype_GetFontData, /* pGetFontData */
freetype_GetFontRealizationInfo, /* pGetFontRealizationInfo */
freetype_GetFontUnicodeRanges, /* pGetFontUnicodeRanges */
freetype_GetGlyphIndices, /* pGetGlyphIndices */
freetype_GetGlyphOutline, /* pGetGlyphOutline */

View File

@ -280,6 +280,7 @@
# @ stub GetFontAssocStatus
@ stdcall GetFontData(long long long ptr long)
@ stdcall GetFontLanguageInfo(long)
@ stdcall GetFontRealizationInfo(long ptr)
@ stub GetFontResourceInfo
@ stdcall GetFontResourceInfoW(wstr ptr ptr long)
@ stdcall GetFontUnicodeRanges(ptr ptr)

View File

@ -276,14 +276,16 @@ extern HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, BOOL on_disk ) D
/* freetype.c */
/* Undocumented structure filled in by GdiRealizationInfo */
typedef struct
/* Undocumented structure filled in by GetFontRealizationInfo */
struct font_realization_info
{
DWORD size; /* could be 16 or 24 */
DWORD flags; /* 1 for bitmap fonts, 3 for scalable fonts */
DWORD cache_num; /* keeps incrementing - num of fonts that have been created allowing for caching?? */
DWORD instance_id; /* identifies a realized font instance */
} realization_info_t;
DWORD unk; /* unknown */
DWORD face_index; /* face index in case of font collections */
};
extern INT WineEngAddFontResourceEx(LPCWSTR, DWORD, PVOID) DECLSPEC_HIDDEN;
extern HANDLE WineEngAddFontMemResourceEx(PVOID, DWORD, PVOID, LPDWORD) DECLSPEC_HIDDEN;

View File

@ -132,7 +132,6 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
NULL, /* pFontIsLinked */
MFDRV_FrameRgn, /* pFrameRgn */
NULL, /* pGdiComment */
NULL, /* pGdiRealizationInfo */
MFDRV_GetBoundsRect, /* pGetBoundsRect */
NULL, /* pGetCharABCWidths */
NULL, /* pGetCharABCWidthsI */
@ -140,6 +139,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
MFDRV_GetDeviceCaps, /* pGetDeviceCaps */
NULL, /* pGetDeviceGammaRamp */
NULL, /* pGetFontData */
NULL, /* pGetFontRealizationInfo */
NULL, /* pGetFontUnicodeRanges */
NULL, /* pGetGlyphIndices */
NULL, /* pGetGlyphOutline */

View File

@ -2251,7 +2251,6 @@ const struct gdi_dc_funcs path_driver =
NULL, /* pFontIsLinked */
NULL, /* pFrameRgn */
NULL, /* pGdiComment */
NULL, /* pGdiRealizationInfo */
NULL, /* pGetBoundsRect */
NULL, /* pGetCharABCWidths */
NULL, /* pGetCharABCWidthsI */
@ -2259,6 +2258,7 @@ const struct gdi_dc_funcs path_driver =
NULL, /* pGetDeviceCaps */
NULL, /* pGetDeviceGammaRamp */
NULL, /* pGetFontData */
NULL, /* pGetFontRealizationInfo */
NULL, /* pGetFontUnicodeRanges */
NULL, /* pGetGlyphIndices */
NULL, /* pGetGlyphOutline */

View File

@ -4222,6 +4222,7 @@ static void test_RealizationInfo(void)
ok(info2[6] == 0xcccccccc, "structure longer than 6 dwords\n");
/* Test GetFontFileInfo() */
if (pGetFontFileInfo) {
r = pGetFontFileInfo(fri->instance_id, 0, &file_info, sizeof(file_info), &needed);
ok(r != 0 || GetLastError() == ERROR_NOACCESS, "ret %d gle %d\n", r, GetLastError());
@ -4250,6 +4251,7 @@ static void test_RealizationInfo(void)
else
win_skip("GetFontFileInfo() failed, skipping\n");
}
}
DeleteObject(SelectObject(hdc, hfont_old));

View File

@ -444,7 +444,6 @@ static const struct gdi_dc_funcs macdrv_funcs =
NULL, /* pFontIsLinked */
NULL, /* pFrameRgn */
NULL, /* pGdiComment */
NULL, /* pGdiRealizationInfo */
NULL, /* pGetBoundsRect */
NULL, /* pGetCharABCWidths */
NULL, /* pGetCharABCWidthsI */
@ -452,6 +451,7 @@ static const struct gdi_dc_funcs macdrv_funcs =
macdrv_GetDeviceCaps, /* pGetDeviceCaps */
macdrv_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */
NULL, /* pGetFontData */
NULL, /* pGetFontRealizationInfo */
NULL, /* pGetFontUnicodeRanges */
NULL, /* pGetGlyphIndices */
NULL, /* pGetGlyphOutline */

View File

@ -856,7 +856,6 @@ static const struct gdi_dc_funcs psdrv_funcs =
NULL, /* pFontIsLinked */
NULL, /* pFrameRgn */
NULL, /* pGdiComment */
NULL, /* pGdiRealizationInfo */
NULL, /* pGetBoundsRect */
NULL, /* pGetCharABCWidths */
NULL, /* pGetCharABCWidthsI */
@ -864,6 +863,7 @@ static const struct gdi_dc_funcs psdrv_funcs =
PSDRV_GetDeviceCaps, /* pGetDeviceCaps */
NULL, /* pGetDeviceGammaRamp */
NULL, /* pGetFontData */
NULL, /* pGetFontRealizationInfo */
NULL, /* pGetFontUnicodeRanges */
NULL, /* pGetGlyphIndices */
NULL, /* pGetGlyphOutline */

View File

@ -500,7 +500,6 @@ static const struct gdi_dc_funcs x11drv_funcs =
NULL, /* pFontIsLinked */
NULL, /* pFrameRgn */
NULL, /* pGdiComment */
NULL, /* pGdiRealizationInfo */
NULL, /* pGetBoundsRect */
NULL, /* pGetCharABCWidths */
NULL, /* pGetCharABCWidthsI */
@ -508,6 +507,7 @@ static const struct gdi_dc_funcs x11drv_funcs =
X11DRV_GetDeviceCaps, /* pGetDeviceCaps */
X11DRV_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */
NULL, /* pGetFontData */
NULL, /* pGetFontRealizationInfo */
NULL, /* pGetFontUnicodeRanges */
NULL, /* pGetGlyphIndices */
NULL, /* pGetGlyphOutline */

View File

@ -2181,7 +2181,6 @@ static const struct gdi_dc_funcs xrender_funcs =
NULL, /* pFontIsLinked */
NULL, /* pFrameRgn */
NULL, /* pGdiComment */
NULL, /* pGdiRealizationInfo */
NULL, /* pGetBoundsRect */
NULL, /* pGetCharABCWidths */
NULL, /* pGetCharABCWidthsI */
@ -2189,6 +2188,7 @@ static const struct gdi_dc_funcs xrender_funcs =
NULL, /* pGetDeviceCaps */
NULL, /* pGetDeviceGammaRamp */
NULL, /* pGetFontData */
NULL, /* pGetFontRealizationInfo */
NULL, /* pGetFontUnicodeRanges */
NULL, /* pGetGlyphIndices */
NULL, /* pGetGlyphOutline */

View File

@ -97,7 +97,6 @@ struct gdi_dc_funcs
BOOL (*pFontIsLinked)(PHYSDEV);
BOOL (*pFrameRgn)(PHYSDEV,HRGN,HBRUSH,INT,INT);
BOOL (*pGdiComment)(PHYSDEV,UINT,const BYTE*);
BOOL (*pGdiRealizationInfo)(PHYSDEV,void*);
UINT (*pGetBoundsRect)(PHYSDEV,RECT*,UINT);
BOOL (*pGetCharABCWidths)(PHYSDEV,UINT,UINT,LPABC);
BOOL (*pGetCharABCWidthsI)(PHYSDEV,UINT,UINT,WORD*,LPABC);
@ -105,6 +104,7 @@ struct gdi_dc_funcs
INT (*pGetDeviceCaps)(PHYSDEV,INT);
BOOL (*pGetDeviceGammaRamp)(PHYSDEV,LPVOID);
DWORD (*pGetFontData)(PHYSDEV,DWORD,DWORD,LPVOID,DWORD);
BOOL (*pGetFontRealizationInfo)(PHYSDEV,void*);
DWORD (*pGetFontUnicodeRanges)(PHYSDEV,LPGLYPHSET);
DWORD (*pGetGlyphIndices)(PHYSDEV,LPCWSTR,INT,LPWORD,DWORD);
DWORD (*pGetGlyphOutline)(PHYSDEV,UINT,UINT,LPGLYPHMETRICS,DWORD,LPVOID,const MAT2*);
@ -197,7 +197,7 @@ struct gdi_dc_funcs
};
/* increment this when you change the DC function table */
#define WINE_GDI_DRIVER_VERSION 46
#define WINE_GDI_DRIVER_VERSION 47
#define GDI_PRIORITY_NULL_DRV 0 /* null driver */
#define GDI_PRIORITY_FONT_DRV 100 /* any font driver */