Commit a7aca059 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Update to IDWriteFactory5.

parent f95c26ab
......@@ -205,7 +205,7 @@ static const struct fallback_mapping fontfallback_neutral_data[] = {
struct dwrite_fontfallback {
IDWriteFontFallback IDWriteFontFallback_iface;
IDWriteFactory4 *factory;
IDWriteFactory5 *factory;
IDWriteFontCollection1 *systemcollection;
const struct fallback_mapping *mappings;
UINT32 count;
......@@ -1830,14 +1830,14 @@ static ULONG WINAPI fontfallback_AddRef(IDWriteFontFallback *iface)
{
struct dwrite_fontfallback *fallback = impl_from_IDWriteFontFallback(iface);
TRACE("(%p)\n", fallback);
return IDWriteFactory4_AddRef(fallback->factory);
return IDWriteFactory5_AddRef(fallback->factory);
}
static ULONG WINAPI fontfallback_Release(IDWriteFontFallback *iface)
{
struct dwrite_fontfallback *fallback = impl_from_IDWriteFontFallback(iface);
TRACE("(%p)\n", fallback);
return IDWriteFactory4_Release(fallback->factory);
return IDWriteFactory5_Release(fallback->factory);
}
static int compare_fallback_mapping(const void *a, const void *b)
......@@ -2013,7 +2013,7 @@ static const IDWriteFontFallbackVtbl fontfallbackvtbl = {
fontfallback_MapCharacters
};
HRESULT create_system_fontfallback(IDWriteFactory4 *factory, IDWriteFontFallback **ret)
HRESULT create_system_fontfallback(IDWriteFactory5 *factory, IDWriteFontFallback **ret)
{
struct dwrite_fontfallback *fallback;
......@@ -2027,7 +2027,7 @@ HRESULT create_system_fontfallback(IDWriteFactory4 *factory, IDWriteFontFallback
fallback->factory = factory;
fallback->mappings = fontfallback_neutral_data;
fallback->count = sizeof(fontfallback_neutral_data)/sizeof(fontfallback_neutral_data[0]);
IDWriteFactory4_GetSystemFontCollection(fallback->factory, FALSE, &fallback->systemcollection, FALSE);
IDWriteFactory5_GetSystemFontCollection(fallback->factory, FALSE, &fallback->systemcollection, FALSE);
*ret = &fallback->IDWriteFontFallback_iface;
return S_OK;
......
......@@ -120,7 +120,7 @@ static inline BOOL is_simulation_valid(DWRITE_FONT_SIMULATIONS simulations)
struct textlayout_desc
{
IDWriteFactory4 *factory;
IDWriteFactory5 *factory;
const WCHAR *string;
UINT32 length;
IDWriteTextFormat *format;
......@@ -148,7 +148,7 @@ struct glyphrunanalysis_desc
struct fontface_desc
{
IDWriteFactory4 *factory;
IDWriteFactory5 *factory;
DWRITE_FONT_FACE_TYPE face_type;
IDWriteFontFile * const *files;
UINT32 files_number;
......@@ -161,19 +161,19 @@ extern HRESULT create_numbersubstitution(DWRITE_NUMBER_SUBSTITUTION_METHOD,const
extern HRESULT create_textformat(const WCHAR*,IDWriteFontCollection*,DWRITE_FONT_WEIGHT,DWRITE_FONT_STYLE,DWRITE_FONT_STRETCH,
FLOAT,const WCHAR*,IDWriteTextFormat**) DECLSPEC_HIDDEN;
extern HRESULT create_textlayout(const struct textlayout_desc*,IDWriteTextLayout**) DECLSPEC_HIDDEN;
extern HRESULT create_trimmingsign(IDWriteFactory4*,IDWriteTextFormat*,IDWriteInlineObject**) DECLSPEC_HIDDEN;
extern HRESULT create_trimmingsign(IDWriteFactory5*,IDWriteTextFormat*,IDWriteInlineObject**) DECLSPEC_HIDDEN;
extern HRESULT create_typography(IDWriteTypography**) DECLSPEC_HIDDEN;
extern HRESULT create_localizedstrings(IDWriteLocalizedStrings**) DECLSPEC_HIDDEN;
extern HRESULT add_localizedstring(IDWriteLocalizedStrings*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN;
extern HRESULT clone_localizedstring(IDWriteLocalizedStrings *iface, IDWriteLocalizedStrings **strings) DECLSPEC_HIDDEN;
extern void set_en_localizedstring(IDWriteLocalizedStrings*,const WCHAR*) DECLSPEC_HIDDEN;
extern HRESULT get_system_fontcollection(IDWriteFactory4*,IDWriteFontCollection1**) DECLSPEC_HIDDEN;
extern HRESULT get_eudc_fontcollection(IDWriteFactory4*,IDWriteFontCollection1**) DECLSPEC_HIDDEN;
extern HRESULT get_system_fontcollection(IDWriteFactory5*,IDWriteFontCollection1**) DECLSPEC_HIDDEN;
extern HRESULT get_eudc_fontcollection(IDWriteFactory5*,IDWriteFontCollection1**) DECLSPEC_HIDDEN;
extern HRESULT get_textanalyzer(IDWriteTextAnalyzer**) DECLSPEC_HIDDEN;
extern HRESULT create_font_file(IDWriteFontFileLoader *loader, const void *reference_key, UINT32 key_size, IDWriteFontFile **font_file) DECLSPEC_HIDDEN;
extern HRESULT create_localfontfileloader(IDWriteLocalFontFileLoader** iface) DECLSPEC_HIDDEN;
extern HRESULT create_fontface(const struct fontface_desc*,struct list*,IDWriteFontFace4**) DECLSPEC_HIDDEN;
extern HRESULT create_font_collection(IDWriteFactory4*,IDWriteFontFileEnumerator*,BOOL,IDWriteFontCollection1**) DECLSPEC_HIDDEN;
extern HRESULT create_font_collection(IDWriteFactory5*,IDWriteFontFileEnumerator*,BOOL,IDWriteFontCollection1**) 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;
......@@ -183,21 +183,21 @@ extern HRESULT get_family_names_from_stream(IDWriteFontFileStream*,UINT32,DWRITE
extern HRESULT create_colorglyphenum(FLOAT,FLOAT,const DWRITE_GLYPH_RUN*,const DWRITE_GLYPH_RUN_DESCRIPTION*,DWRITE_MEASURING_MODE,
const DWRITE_MATRIX*,UINT32,IDWriteColorGlyphRunEnumerator**) DECLSPEC_HIDDEN;
extern BOOL lb_is_newline_char(WCHAR) DECLSPEC_HIDDEN;
extern HRESULT create_system_fontfallback(IDWriteFactory4*,IDWriteFontFallback**) DECLSPEC_HIDDEN;
extern HRESULT create_system_fontfallback(IDWriteFactory5*,IDWriteFontFallback**) DECLSPEC_HIDDEN;
extern void release_system_fontfallback(IDWriteFontFallback*) DECLSPEC_HIDDEN;
extern HRESULT create_matching_font(IDWriteFontCollection*,const WCHAR*,DWRITE_FONT_WEIGHT,DWRITE_FONT_STYLE,DWRITE_FONT_STRETCH,
IDWriteFont**) DECLSPEC_HIDDEN;
extern HRESULT create_fontfacereference(IDWriteFactory4*,IDWriteFontFile*,UINT32,DWRITE_FONT_SIMULATIONS,
extern HRESULT create_fontfacereference(IDWriteFactory5*,IDWriteFontFile*,UINT32,DWRITE_FONT_SIMULATIONS,
IDWriteFontFaceReference**) DECLSPEC_HIDDEN;
extern HRESULT factory_get_cached_fontface(IDWriteFactory4*,IDWriteFontFile*const*,UINT32,DWRITE_FONT_SIMULATIONS,IDWriteFontFace**,
extern HRESULT factory_get_cached_fontface(IDWriteFactory5*,IDWriteFontFile*const*,UINT32,DWRITE_FONT_SIMULATIONS,IDWriteFontFace**,
struct list**) DECLSPEC_HIDDEN;
extern void factory_detach_fontcollection(IDWriteFactory4*,IDWriteFontCollection1*) DECLSPEC_HIDDEN;
extern void factory_detach_gdiinterop(IDWriteFactory4*,IDWriteGdiInterop1*) DECLSPEC_HIDDEN;
extern void factory_detach_fontcollection(IDWriteFactory5*,IDWriteFontCollection1*) DECLSPEC_HIDDEN;
extern void factory_detach_gdiinterop(IDWriteFactory5*,IDWriteGdiInterop1*) DECLSPEC_HIDDEN;
extern struct fontfacecached *factory_cache_fontface(struct list*,IDWriteFontFace4*) DECLSPEC_HIDDEN;
extern void factory_release_cached_fontface(struct fontfacecached*) DECLSPEC_HIDDEN;
extern void get_logfont_from_font(IDWriteFont*,LOGFONTW*) DECLSPEC_HIDDEN;
extern void get_logfont_from_fontface(IDWriteFontFace*,LOGFONTW*) DECLSPEC_HIDDEN;
extern HRESULT create_gdiinterop(IDWriteFactory4*,IDWriteGdiInterop1**) DECLSPEC_HIDDEN;
extern HRESULT create_gdiinterop(IDWriteFactory5*,IDWriteGdiInterop1**) DECLSPEC_HIDDEN;
/* Opentype font table functions */
struct dwrite_font_props {
......
......@@ -115,7 +115,7 @@ struct dwrite_fontcollection {
IDWriteFontCollection1 IDWriteFontCollection1_iface;
LONG ref;
IDWriteFactory4 *factory;
IDWriteFactory5 *factory;
struct dwrite_fontfamily_data **family_data;
UINT32 family_count;
UINT32 family_alloc;
......@@ -221,7 +221,7 @@ struct dwrite_fontface {
UINT32 file_count;
UINT32 index;
IDWriteFactory4 *factory;
IDWriteFactory5 *factory;
struct fontfacecached *cached;
USHORT simulations;
......@@ -264,7 +264,7 @@ struct dwrite_fontfacereference {
IDWriteFontFile *file;
UINT32 index;
USHORT simulations;
IDWriteFactory4 *factory;
IDWriteFactory5 *factory;
};
static inline struct dwrite_fontface *impl_from_IDWriteFontFace4(IDWriteFontFace4 *iface)
......@@ -504,7 +504,7 @@ static ULONG WINAPI dwritefontface_Release(IDWriteFontFace4 *iface)
if (This->cached)
factory_release_cached_fontface(This->cached);
if (This->factory)
IDWriteFactory4_Release(This->factory);
IDWriteFactory5_Release(This->factory);
heap_free(This);
}
......@@ -1668,7 +1668,7 @@ static HRESULT WINAPI dwritefont3_GetFontFaceReference(IDWriteFont3 *iface, IDWr
TRACE("(%p)->(%p)\n", This, reference);
return IDWriteFactory4_CreateFontFaceReference_(This->family->collection->factory, This->data->file,
return IDWriteFactory5_CreateFontFaceReference_(This->family->collection->factory, This->data->file,
This->data->face_index, This->data->simulations, reference);
}
......@@ -3613,7 +3613,7 @@ static void fontcollection_add_replacements(struct dwrite_fontcollection *collec
RegCloseKey(hkey);
}
HRESULT create_font_collection(IDWriteFactory4 *factory, IDWriteFontFileEnumerator *enumerator, BOOL is_system,
HRESULT create_font_collection(IDWriteFactory5 *factory, IDWriteFontFileEnumerator *enumerator, BOOL is_system,
IDWriteFontCollection1 **ret)
{
struct fontfile_enum {
......@@ -3758,7 +3758,7 @@ HRESULT create_font_collection(IDWriteFactory4 *factory, IDWriteFontFileEnumerat
fontcollection_add_replacements(collection);
collection->factory = factory;
IDWriteFactory4_AddRef(factory);
IDWriteFactory5_AddRef(factory);
return hr;
}
......@@ -3768,7 +3768,7 @@ struct system_fontfile_enumerator
IDWriteFontFileEnumerator IDWriteFontFileEnumerator_iface;
LONG ref;
IDWriteFactory4 *factory;
IDWriteFactory5 *factory;
HKEY hkey;
int index;
......@@ -3806,7 +3806,7 @@ static ULONG WINAPI systemfontfileenumerator_Release(IDWriteFontFileEnumerator *
ULONG ref = InterlockedDecrement(&enumerator->ref);
if (!ref) {
IDWriteFactory4_Release(enumerator->factory);
IDWriteFactory5_Release(enumerator->factory);
RegCloseKey(enumerator->hkey);
heap_free(enumerator->value);
heap_free(enumerator);
......@@ -3815,7 +3815,7 @@ static ULONG WINAPI systemfontfileenumerator_Release(IDWriteFontFileEnumerator *
return ref;
}
static HRESULT create_local_file_reference(IDWriteFactory4 *factory, const WCHAR *filename, IDWriteFontFile **file)
static HRESULT create_local_file_reference(IDWriteFactory5 *factory, const WCHAR *filename, IDWriteFontFile **file)
{
HRESULT hr;
......@@ -3828,10 +3828,10 @@ static HRESULT create_local_file_reference(IDWriteFactory4 *factory, const WCHAR
strcatW(fullpathW, fontsW);
strcatW(fullpathW, filename);
hr = IDWriteFactory4_CreateFontFileReference(factory, fullpathW, NULL, file);
hr = IDWriteFactory5_CreateFontFileReference(factory, fullpathW, NULL, file);
}
else
hr = IDWriteFactory4_CreateFontFileReference(factory, filename, NULL, file);
hr = IDWriteFactory5_CreateFontFileReference(factory, filename, NULL, file);
return hr;
}
......@@ -3921,7 +3921,7 @@ static const struct IDWriteFontFileEnumeratorVtbl systemfontfileenumeratorvtbl =
systemfontfileenumerator_GetCurrentFontFile
};
static HRESULT create_system_fontfile_enumerator(IDWriteFactory4 *factory, IDWriteFontFileEnumerator **ret)
static HRESULT create_system_fontfile_enumerator(IDWriteFactory5 *factory, IDWriteFontFileEnumerator **ret)
{
struct system_fontfile_enumerator *enumerator;
static const WCHAR fontslistW[] = {
......@@ -3942,11 +3942,11 @@ static HRESULT create_system_fontfile_enumerator(IDWriteFactory4 *factory, IDWri
enumerator->index = -1;
enumerator->value = NULL;
enumerator->max_val_count = 0;
IDWriteFactory4_AddRef(factory);
IDWriteFactory5_AddRef(factory);
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, fontslistW, 0, GENERIC_READ, &enumerator->hkey)) {
ERR("failed to open fonts list key\n");
IDWriteFactory4_Release(factory);
IDWriteFactory5_Release(factory);
heap_free(enumerator);
return E_FAIL;
}
......@@ -3956,7 +3956,7 @@ static HRESULT create_system_fontfile_enumerator(IDWriteFactory4 *factory, IDWri
return S_OK;
}
HRESULT get_system_fontcollection(IDWriteFactory4 *factory, IDWriteFontCollection1 **collection)
HRESULT get_system_fontcollection(IDWriteFactory5 *factory, IDWriteFontCollection1 **collection)
{
IDWriteFontFileEnumerator *enumerator;
HRESULT hr;
......@@ -3973,7 +3973,7 @@ HRESULT get_system_fontcollection(IDWriteFactory4 *factory, IDWriteFontCollectio
return hr;
}
static HRESULT eudc_collection_add_family(IDWriteFactory4 *factory, struct dwrite_fontcollection *collection,
static HRESULT eudc_collection_add_family(IDWriteFactory5 *factory, struct dwrite_fontcollection *collection,
const WCHAR *keynameW, const WCHAR *pathW)
{
static const WCHAR defaultfontW[] = {'S','y','s','t','e','m','D','e','f','a','u','l','t','E','U','D','C','F','o','n','t',0};
......@@ -4052,7 +4052,7 @@ static HRESULT eudc_collection_add_family(IDWriteFactory4 *factory, struct dwrit
return hr;
}
HRESULT get_eudc_fontcollection(IDWriteFactory4 *factory, IDWriteFontCollection1 **ret)
HRESULT get_eudc_fontcollection(IDWriteFactory5 *factory, IDWriteFontCollection1 **ret)
{
static const WCHAR eudckeyfmtW[] = {'E','U','D','C','\\','%','u',0};
struct dwrite_fontcollection *collection;
......@@ -4080,7 +4080,7 @@ HRESULT get_eudc_fontcollection(IDWriteFactory4 *factory, IDWriteFontCollection1
*ret = &collection->IDWriteFontCollection1_iface;
collection->factory = factory;
IDWriteFactory4_AddRef(factory);
IDWriteFactory5_AddRef(factory);
/* return empty collection if EUDC fonts are not configured */
sprintfW(eudckeypathW, eudckeyfmtW, GetACP());
......@@ -4380,7 +4380,7 @@ HRESULT create_fontface(const struct fontface_desc *desc, struct list *cached_li
}
fontface->cached = factory_cache_fontface(cached_list, &fontface->IDWriteFontFace4_iface);
IDWriteFactory4_AddRef(fontface->factory = desc->factory);
IDWriteFactory5_AddRef(fontface->factory = desc->factory);
*ret = &fontface->IDWriteFontFace4_iface;
return S_OK;
......@@ -5630,7 +5630,7 @@ static ULONG WINAPI fontfacereference_Release(IDWriteFontFaceReference *iface)
if (!ref) {
IDWriteFontFile_Release(This->file);
IDWriteFactory4_Release(This->factory);
IDWriteFactory5_Release(This->factory);
heap_free(This);
}
......@@ -5663,7 +5663,7 @@ static HRESULT WINAPI fontfacereference_CreateFontFaceWithSimulations(IDWriteFon
if (FAILED(hr))
return hr;
hr = IDWriteFactory4_CreateFontFace(This->factory, face_type, 1, &This->file, This->index, simulations, &fontface);
hr = IDWriteFactory5_CreateFontFace(This->factory, face_type, 1, &This->file, This->index, simulations, &fontface);
if (SUCCEEDED(hr)) {
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (void **)ret);
IDWriteFontFace_Release(fontface);
......@@ -5727,7 +5727,7 @@ static HRESULT WINAPI fontfacereference_GetFontFile(IDWriteFontFaceReference *if
if (FAILED(hr))
return hr;
hr = IDWriteFactory4_CreateCustomFontFileReference(This->factory, key, key_size, loader, file);
hr = IDWriteFactory5_CreateCustomFontFileReference(This->factory, key, key_size, loader, file);
IDWriteFontFileLoader_Release(loader);
return hr;
......@@ -5828,7 +5828,7 @@ static const IDWriteFontFaceReferenceVtbl fontfacereferencevtbl = {
fontfacereference_EnqueueFileFragmentDownloadRequest
};
HRESULT create_fontfacereference(IDWriteFactory4 *factory, IDWriteFontFile *file, UINT32 index,
HRESULT create_fontfacereference(IDWriteFactory5 *factory, IDWriteFontFile *file, UINT32 index,
DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFaceReference **ret)
{
struct dwrite_fontfacereference *ref;
......@@ -5846,7 +5846,7 @@ HRESULT create_fontfacereference(IDWriteFactory4 *factory, IDWriteFontFile *file
ref->ref = 1;
ref->factory = factory;
IDWriteFactory4_AddRef(ref->factory);
IDWriteFactory5_AddRef(ref->factory);
ref->file = file;
IDWriteFontFile_AddRef(ref->file);
ref->index = index;
......
......@@ -55,7 +55,7 @@ struct rendertarget {
struct gdiinterop {
IDWriteGdiInterop1 IDWriteGdiInterop1_iface;
LONG ref;
IDWriteFactory4 *factory;
IDWriteFactory5 *factory;
};
static inline int get_dib_stride(int width, int bpp)
......@@ -753,7 +753,7 @@ static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop1 *iface
return E_FAIL;
}
hr = IDWriteFactory4_CreateFontFileReference(This->factory, fileinfo->path, &fileinfo->writetime,
hr = IDWriteFactory5_CreateFontFileReference(This->factory, fileinfo->path, &fileinfo->writetime,
&file);
heap_free(fileinfo);
if (FAILED(hr))
......@@ -764,7 +764,7 @@ static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop1 *iface
if (SUCCEEDED(hr)) {
if (is_supported)
/* Simulations flags values match DWRITE_FONT_SIMULATIONS */
hr = IDWriteFactory4_CreateFontFace(This->factory, facetype, 1, &file, info.face_index,
hr = IDWriteFactory5_CreateFontFace(This->factory, facetype, 1, &file, info.face_index,
info.simulations, fontface);
else
hr = DWRITE_E_FILEFORMAT;
......@@ -801,7 +801,7 @@ static HRESULT WINAPI gdiinterop1_CreateFontFromLOGFONT(IDWriteGdiInterop1 *ifac
if (collection)
IDWriteFontCollection_AddRef(collection);
else {
hr = IDWriteFactory4_GetSystemFontCollection(This->factory, FALSE, (IDWriteFontCollection1**)&collection, FALSE);
hr = IDWriteFactory5_GetSystemFontCollection(This->factory, FALSE, (IDWriteFontCollection1**)&collection, FALSE);
if (FAILED(hr)) {
ERR("failed to get system font collection: 0x%08x.\n", hr);
return hr;
......@@ -906,7 +906,7 @@ static const struct IDWriteGdiInterop1Vtbl gdiinteropvtbl = {
gdiinterop1_GetMatchingFontsByLOGFONT
};
HRESULT create_gdiinterop(IDWriteFactory4 *factory, IDWriteGdiInterop1 **ret)
HRESULT create_gdiinterop(IDWriteFactory5 *factory, IDWriteGdiInterop1 **ret)
{
struct gdiinterop *interop;
......@@ -917,7 +917,7 @@ HRESULT create_gdiinterop(IDWriteFactory4 *factory, IDWriteGdiInterop1 **ret)
interop->IDWriteGdiInterop1_iface.lpVtbl = &gdiinteropvtbl;
interop->ref = 1;
IDWriteFactory4_AddRef(interop->factory = factory);
IDWriteFactory5_AddRef(interop->factory = factory);
*ret = &interop->IDWriteGdiInterop1_iface;
return S_OK;
......
......@@ -242,7 +242,7 @@ struct dwrite_textlayout {
IDWriteTextAnalysisSource1 IDWriteTextAnalysisSource1_iface;
LONG ref;
IDWriteFactory4 *factory;
IDWriteFactory5 *factory;
WCHAR *str;
UINT32 len;
......@@ -805,7 +805,7 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout)
IDWriteFontFallback_AddRef(fallback);
}
else {
hr = IDWriteFactory4_GetSystemFontFallback(layout->factory, &fallback);
hr = IDWriteFactory5_GetSystemFontFallback(layout->factory, &fallback);
if (FAILED(hr))
return hr;
}
......@@ -829,7 +829,7 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout)
IDWriteFontCollection_AddRef(collection);
}
else
IDWriteFactory4_GetSystemFontCollection(layout->factory, FALSE, (IDWriteFontCollection1**)&collection, FALSE);
IDWriteFactory5_GetSystemFontCollection(layout->factory, FALSE, (IDWriteFontCollection1 **)&collection, FALSE);
hr = create_matching_font(collection, range->fontfamily, range->weight,
range->style, range->stretch, &font);
......@@ -2778,7 +2778,7 @@ static ULONG WINAPI dwritetextlayout_Release(IDWriteTextLayout3 *iface)
TRACE("(%p)->(%d)\n", This, ref);
if (!ref) {
IDWriteFactory4_Release(This->factory);
IDWriteFactory5_Release(This->factory);
free_layout_ranges_list(This);
free_layout_eruns(This);
free_layout_runs(This);
......@@ -4902,7 +4902,7 @@ static HRESULT init_textlayout(const struct textlayout_desc *desc, struct dwrite
layout->transform = desc->transform ? *desc->transform : identity;
layout->factory = desc->factory;
IDWriteFactory4_AddRef(layout->factory);
IDWriteFactory5_AddRef(layout->factory);
list_add_head(&layout->ranges, &range->entry);
list_add_head(&layout->strike_ranges, &strike->entry);
list_add_head(&layout->underline_ranges, &underline->entry);
......@@ -5068,7 +5068,7 @@ static inline BOOL is_flow_direction_vert(DWRITE_FLOW_DIRECTION direction)
(direction == DWRITE_FLOW_DIRECTION_BOTTOM_TO_TOP);
}
HRESULT create_trimmingsign(IDWriteFactory4 *factory, IDWriteTextFormat *format, IDWriteInlineObject **sign)
HRESULT create_trimmingsign(IDWriteFactory5 *factory, IDWriteTextFormat *format, IDWriteInlineObject **sign)
{
static const WCHAR ellipsisW = 0x2026;
struct dwrite_trimmingsign *This;
......@@ -5094,7 +5094,7 @@ HRESULT create_trimmingsign(IDWriteFactory4 *factory, IDWriteTextFormat *format,
This->IDWriteInlineObject_iface.lpVtbl = &dwritetrimmingsignvtbl;
This->ref = 1;
hr = IDWriteFactory4_CreateTextLayout(factory, &ellipsisW, 1, format, 0.0f, 0.0f, &This->layout);
hr = IDWriteFactory5_CreateTextLayout(factory, &ellipsisW, 1, format, 0.0f, 0.0f, &This->layout);
if (FAILED(hr)) {
heap_free(This);
return hr;
......
......@@ -7345,14 +7345,21 @@ static void test_inmemory_file_loader(void)
hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory5, (void **)&factory5);
IDWriteFactory_Release(factory);
if (FAILED(hr)) {
skip("CreateInMemoryFontFileLoader is not supported\n");
win_skip("CreateInMemoryFontFileLoader is not supported\n");
return;
}
fontface = create_fontface((IDWriteFactory *)factory5);
hr = IDWriteFactory5_CreateInMemoryFontFileLoader(factory5, &loader);
todo_wine
ok(hr == S_OK, "got %#x\n", hr);
if (FAILED(hr)) {
IDWriteFactory5_Release(factory5);
return;
}
fontface = create_fontface((IDWriteFactory *)factory5);
hr = IDWriteFactory5_CreateInMemoryFontFileLoader(factory5, &loader2);
ok(hr == S_OK, "got %#x\n", hr);
ok(loader != loader2, "unexpected pointer\n");
......
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