Commit 3360dfec authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Update to IDWriteFontCollection3.

parent 3afa0d63
......@@ -239,13 +239,14 @@ extern HRESULT clone_localizedstring(IDWriteLocalizedStrings *iface, IDWriteLoca
extern void set_en_localizedstring(IDWriteLocalizedStrings*,const WCHAR*) DECLSPEC_HIDDEN;
extern void sort_localizedstrings(IDWriteLocalizedStrings*) DECLSPEC_HIDDEN;
extern HRESULT get_system_fontcollection(IDWriteFactory5*,IDWriteFontCollection1**) DECLSPEC_HIDDEN;
extern HRESULT get_eudc_fontcollection(IDWriteFactory5*,IDWriteFontCollection1**) DECLSPEC_HIDDEN;
extern HRESULT get_eudc_fontcollection(IDWriteFactory5 *factory, IDWriteFontCollection3 **collection) DECLSPEC_HIDDEN;
extern IDWriteTextAnalyzer *get_text_analyzer(void) DECLSPEC_HIDDEN;
extern HRESULT create_font_file(IDWriteFontFileLoader *loader, const void *reference_key, UINT32 key_size, IDWriteFontFile **font_file) DECLSPEC_HIDDEN;
extern void init_local_fontfile_loader(void) DECLSPEC_HIDDEN;
extern IDWriteFontFileLoader *get_local_fontfile_loader(void) DECLSPEC_HIDDEN;
extern HRESULT create_fontface(const struct fontface_desc*,struct list*,IDWriteFontFace4**) DECLSPEC_HIDDEN;
extern HRESULT create_font_collection(IDWriteFactory5*,IDWriteFontFileEnumerator*,BOOL,IDWriteFontCollection1**) DECLSPEC_HIDDEN;
extern HRESULT create_font_collection(IDWriteFactory5 *factory, IDWriteFontFileEnumerator *enumerator, BOOL is_system,
IDWriteFontCollection3 **collection) DECLSPEC_HIDDEN;
extern HRESULT create_glyphrunanalysis(const struct glyphrunanalysis_desc*,IDWriteGlyphRunAnalysis**) DECLSPEC_HIDDEN;
extern BOOL is_system_collection(IDWriteFontCollection*) DECLSPEC_HIDDEN;
extern HRESULT get_local_refkey(const WCHAR*,const FILETIME*,void**,UINT32*) DECLSPEC_HIDDEN;
......@@ -264,7 +265,7 @@ extern HRESULT create_fontfacereference(IDWriteFactory5*,IDWriteFontFile*,UINT32
IDWriteFontFaceReference**) DECLSPEC_HIDDEN;
extern HRESULT factory_get_cached_fontface(IDWriteFactory5*,IDWriteFontFile*const*,UINT32,DWRITE_FONT_SIMULATIONS,
struct list**,REFIID,void**) DECLSPEC_HIDDEN;
extern void factory_detach_fontcollection(IDWriteFactory5*,IDWriteFontCollection1*) DECLSPEC_HIDDEN;
extern void factory_detach_fontcollection(IDWriteFactory5 *factory, IDWriteFontCollection3 *collection) DECLSPEC_HIDDEN;
extern void factory_detach_gdiinterop(IDWriteFactory5*,IDWriteGdiInterop1*) DECLSPEC_HIDDEN;
extern struct fontfacecached *factory_cache_fontface(IDWriteFactory5*,struct list*,IDWriteFontFace4*) DECLSPEC_HIDDEN;
extern void get_logfont_from_font(IDWriteFont*,LOGFONTW*) DECLSPEC_HIDDEN;
......
......@@ -753,7 +753,7 @@ static HRESULT WINAPI dwritefactory_CreateCustomFontCollection(IDWriteFactory5 *
if (FAILED(hr))
return hr;
hr = create_font_collection(iface, enumerator, FALSE, (IDWriteFontCollection1**)collection);
hr = create_font_collection(iface, enumerator, FALSE, (IDWriteFontCollection3 **)collection);
IDWriteFontFileEnumerator_Release(enumerator);
return hr;
}
......@@ -1292,7 +1292,7 @@ static HRESULT WINAPI dwritefactory1_GetEudcFontCollection(IDWriteFactory5 *ifac
if (This->eudc_collection)
IDWriteFontCollection1_AddRef(This->eudc_collection);
else {
IDWriteFontCollection1 *eudc_collection;
IDWriteFontCollection3 *eudc_collection;
if (FAILED(hr = get_eudc_fontcollection(iface, &eudc_collection))) {
*collection = NULL;
......@@ -1301,7 +1301,7 @@ static HRESULT WINAPI dwritefactory1_GetEudcFontCollection(IDWriteFactory5 *ifac
}
if (InterlockedCompareExchangePointer((void **)&This->eudc_collection, eudc_collection, NULL))
IDWriteFontCollection1_Release(eudc_collection);
IDWriteFontCollection3_Release(eudc_collection);
}
*collection = (IDWriteFontCollection *)This->eudc_collection;
......@@ -1827,7 +1827,7 @@ static void init_dwritefactory(struct dwritefactory *factory, DWRITE_FACTORY_TYP
factory->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": dwritefactory.lock");
}
void factory_detach_fontcollection(IDWriteFactory5 *iface, IDWriteFontCollection1 *collection)
void factory_detach_fontcollection(IDWriteFactory5 *iface, IDWriteFontCollection3 *collection)
{
struct dwritefactory *factory = impl_from_IDWriteFactory5(iface);
InterlockedCompareExchangePointer((void **)&factory->system_collection, NULL, collection);
......
......@@ -2365,6 +2365,7 @@ static void test_system_fontcollection(void)
IDWriteFontCollection *collection, *coll2;
IDWriteLocalFontFileLoader *localloader;
IDWriteFontCollection1 *collection1;
IDWriteFontCollection3 *collection3;
IDWriteFactory *factory, *factory2;
IDWriteFontFileLoader *loader;
IDWriteFontFamily *family;
......@@ -2540,6 +2541,20 @@ static void test_system_fontcollection(void)
else
win_skip("IDWriteFontCollection1 is not supported.\n");
hr = IDWriteFontCollection_QueryInterface(collection, &IID_IDWriteFontCollection3, (void **)&collection3);
if (SUCCEEDED(hr))
{
HANDLE event;
event = IDWriteFontCollection3_GetExpirationEvent(collection3);
todo_wine
ok(!!event, "Expected event handle.\n");
IDWriteFontCollection3_Release(collection3);
}
else
win_skip("IDWriteFontCollection3 is not supported.\n");
ref = IDWriteFontCollection_Release(collection);
ok(ref == 0, "collection not released, %u\n", ref);
ref = IDWriteFactory_Release(factory);
......
......@@ -377,7 +377,7 @@ interface IDWriteFontCollection2 : IDWriteFontCollection1
]
interface IDWriteFontCollection3 : IDWriteFontCollection2
{
HANDLE GetExiprationEvent();
HANDLE GetExpirationEvent();
}
[
......
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