dwrite: Update to IDWriteFactory4.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-10-11 15:20:26 +03:00 committed by Alexandre Julliard
parent 0e5eed109d
commit 988cf549fc
6 changed files with 203 additions and 166 deletions

View File

@ -193,7 +193,7 @@ static const struct fallback_mapping fontfallback_neutral_data[] = {
struct dwrite_fontfallback {
IDWriteFontFallback IDWriteFontFallback_iface;
IDWriteFactory3 *factory;
IDWriteFactory4 *factory;
IDWriteFontCollection1 *systemcollection;
const struct fallback_mapping *mappings;
UINT32 count;
@ -1785,14 +1785,14 @@ static ULONG WINAPI fontfallback_AddRef(IDWriteFontFallback *iface)
{
struct dwrite_fontfallback *fallback = impl_from_IDWriteFontFallback(iface);
TRACE("(%p)\n", fallback);
return IDWriteFactory3_AddRef(fallback->factory);
return IDWriteFactory4_AddRef(fallback->factory);
}
static ULONG WINAPI fontfallback_Release(IDWriteFontFallback *iface)
{
struct dwrite_fontfallback *fallback = impl_from_IDWriteFontFallback(iface);
TRACE("(%p)\n", fallback);
return IDWriteFactory3_Release(fallback->factory);
return IDWriteFactory4_Release(fallback->factory);
}
static int compare_fallback_mapping(const void *a, const void *b)
@ -1968,7 +1968,7 @@ static const IDWriteFontFallbackVtbl fontfallbackvtbl = {
fontfallback_MapCharacters
};
HRESULT create_system_fontfallback(IDWriteFactory3 *factory, IDWriteFontFallback **ret)
HRESULT create_system_fontfallback(IDWriteFactory4 *factory, IDWriteFontFallback **ret)
{
struct dwrite_fontfallback *fallback;
@ -1982,7 +1982,7 @@ HRESULT create_system_fontfallback(IDWriteFactory3 *factory, IDWriteFontFallback
fallback->factory = factory;
fallback->mappings = fontfallback_neutral_data;
fallback->count = sizeof(fontfallback_neutral_data)/sizeof(fontfallback_neutral_data[0]);
IDWriteFactory3_GetSystemFontCollection(fallback->factory, FALSE, &fallback->systemcollection, FALSE);
IDWriteFactory4_GetSystemFontCollection(fallback->factory, FALSE, &fallback->systemcollection, FALSE);
*ret = &fallback->IDWriteFontFallback_iface;
return S_OK;

View File

@ -121,12 +121,12 @@ static inline BOOL is_simulation_valid(DWRITE_FONT_SIMULATIONS simulations)
struct gdiinterop
{
IDWriteGdiInterop1 IDWriteGdiInterop1_iface;
IDWriteFactory3 *factory;
IDWriteFactory4 *factory;
};
struct textlayout_desc
{
IDWriteFactory3 *factory;
IDWriteFactory4 *factory;
const WCHAR *string;
UINT32 length;
IDWriteTextFormat *format;
@ -154,7 +154,7 @@ struct glyphrunanalysis_desc
struct fontface_desc
{
IDWriteFactory3 *factory;
IDWriteFactory4 *factory;
DWRITE_FONT_FACE_TYPE face_type;
IDWriteFontFile * const *files;
UINT32 files_number;
@ -168,20 +168,20 @@ 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(IDWriteFactory3*,IDWriteTextFormat*,IDWriteInlineObject**) DECLSPEC_HIDDEN;
extern HRESULT create_trimmingsign(IDWriteFactory4*,IDWriteTextFormat*,IDWriteInlineObject**) DECLSPEC_HIDDEN;
extern HRESULT create_typography(IDWriteTypography**) DECLSPEC_HIDDEN;
extern void gdiinterop_init(struct gdiinterop*,IDWriteFactory3*) DECLSPEC_HIDDEN;
extern void gdiinterop_init(struct gdiinterop*,IDWriteFactory4*) 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(IDWriteFactory3*,IDWriteFontCollection1**) DECLSPEC_HIDDEN;
extern HRESULT get_eudc_fontcollection(IDWriteFactory3*,IDWriteFontCollection**) DECLSPEC_HIDDEN;
extern HRESULT get_system_fontcollection(IDWriteFactory4*,IDWriteFontCollection1**) DECLSPEC_HIDDEN;
extern HRESULT get_eudc_fontcollection(IDWriteFactory4*,IDWriteFontCollection**) 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*,IDWriteFontFace3**) DECLSPEC_HIDDEN;
extern HRESULT create_font_collection(IDWriteFactory3*,IDWriteFontFileEnumerator*,BOOL,IDWriteFontCollection1**) DECLSPEC_HIDDEN;
extern HRESULT create_font_collection(IDWriteFactory4*,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;
@ -191,13 +191,13 @@ 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(IDWriteFactory3*,IDWriteFontFallback**) DECLSPEC_HIDDEN;
extern HRESULT create_system_fontfallback(IDWriteFactory4*,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(IDWriteFactory3*,IDWriteFontFile*,UINT32,DWRITE_FONT_SIMULATIONS,
extern HRESULT create_fontfacereference(IDWriteFactory4*,IDWriteFontFile*,UINT32,DWRITE_FONT_SIMULATIONS,
IDWriteFontFaceReference**) DECLSPEC_HIDDEN;
extern HRESULT factory_get_cached_fontface(IDWriteFactory3*,IDWriteFontFile*const*,UINT32,DWRITE_FONT_SIMULATIONS,IDWriteFontFace**,
extern HRESULT factory_get_cached_fontface(IDWriteFactory4*,IDWriteFontFile*const*,UINT32,DWRITE_FONT_SIMULATIONS,IDWriteFontFace**,
struct list**) DECLSPEC_HIDDEN;
extern void factory_cache_fontface(struct list*,IDWriteFontFace3*) DECLSPEC_HIDDEN;

View File

@ -81,7 +81,7 @@ struct dwrite_font_data {
IDWriteLocalizedStrings *names;
/* data needed to create fontface instance */
IDWriteFactory3 *factory;
IDWriteFactory4 *factory;
DWRITE_FONT_FACE_TYPE face_type;
IDWriteFontFile *file;
UINT32 face_index;
@ -258,7 +258,7 @@ struct dwrite_fontfacereference {
IDWriteFontFile *file;
UINT32 index;
USHORT simulations;
IDWriteFactory3 *factory;
IDWriteFactory4 *factory;
};
static inline struct dwrite_fontface *impl_from_IDWriteFontFace3(IDWriteFontFace3 *iface)
@ -414,7 +414,7 @@ static void release_font_data(struct dwrite_font_data *data)
IDWriteLocalizedStrings_Release(data->names);
IDWriteFontFile_Release(data->file);
IDWriteFactory3_Release(data->factory);
IDWriteFactory4_Release(data->factory);
heap_free(data->facename);
heap_free(data);
}
@ -1589,7 +1589,7 @@ static HRESULT WINAPI dwritefont3_GetFontFaceReference(IDWriteFont3 *iface, IDWr
TRACE("(%p)->(%p)\n", This, reference);
return IDWriteFactory3_CreateFontFaceReference_(This->data->factory, This->data->file, This->data->face_index,
return IDWriteFactory4_CreateFontFaceReference_(This->data->factory, This->data->file, This->data->face_index,
This->data->simulations, reference);
}
@ -3188,7 +3188,7 @@ static HRESULT init_font_data(const struct fontface_desc *desc, IDWriteLocalized
data->bold_sim_tested = 0;
data->oblique_sim_tested = 0;
IDWriteFontFile_AddRef(data->file);
IDWriteFactory3_AddRef(data->factory);
IDWriteFactory4_AddRef(data->factory);
stream_desc.stream = stream;
stream_desc.face_type = desc->face_type;
@ -3243,7 +3243,7 @@ static HRESULT init_font_data_from_font(const struct dwrite_font_data *src, DWRI
data->style = DWRITE_FONT_STYLE_OBLIQUE;
memset(data->info_strings, 0, sizeof(data->info_strings));
data->names = NULL;
IDWriteFactory3_AddRef(data->factory);
IDWriteFactory4_AddRef(data->factory);
IDWriteFontFile_AddRef(data->file);
create_localizedstrings(&data->names);
@ -3499,7 +3499,7 @@ static void fontcollection_add_replacements(struct dwrite_fontcollection *collec
RegCloseKey(hkey);
}
HRESULT create_font_collection(IDWriteFactory3 *factory, IDWriteFontFileEnumerator *enumerator, BOOL is_system,
HRESULT create_font_collection(IDWriteFactory4 *factory, IDWriteFontFileEnumerator *enumerator, BOOL is_system,
IDWriteFontCollection1 **ret)
{
struct fontfile_enum {
@ -3651,7 +3651,7 @@ struct system_fontfile_enumerator
IDWriteFontFileEnumerator IDWriteFontFileEnumerator_iface;
LONG ref;
IDWriteFactory3 *factory;
IDWriteFactory4 *factory;
HKEY hkey;
int index;
};
@ -3686,7 +3686,7 @@ static ULONG WINAPI systemfontfileenumerator_Release(IDWriteFontFileEnumerator *
ULONG ref = InterlockedDecrement(&enumerator->ref);
if (!ref) {
IDWriteFactory3_Release(enumerator->factory);
IDWriteFactory4_Release(enumerator->factory);
RegCloseKey(enumerator->hkey);
heap_free(enumerator);
}
@ -3694,7 +3694,7 @@ static ULONG WINAPI systemfontfileenumerator_Release(IDWriteFontFileEnumerator *
return ref;
}
static HRESULT create_local_file_reference(IDWriteFactory3 *factory, const WCHAR *filename, IDWriteFontFile **file)
static HRESULT create_local_file_reference(IDWriteFactory4 *factory, const WCHAR *filename, IDWriteFontFile **file)
{
HRESULT hr;
@ -3707,10 +3707,10 @@ static HRESULT create_local_file_reference(IDWriteFactory3 *factory, const WCHAR
strcatW(fullpathW, fontsW);
strcatW(fullpathW, filename);
hr = IDWriteFactory3_CreateFontFileReference(factory, fullpathW, NULL, file);
hr = IDWriteFactory4_CreateFontFileReference(factory, fullpathW, NULL, file);
}
else
hr = IDWriteFactory3_CreateFontFileReference(factory, filename, NULL, file);
hr = IDWriteFactory4_CreateFontFileReference(factory, filename, NULL, file);
return hr;
}
@ -3798,7 +3798,7 @@ static const struct IDWriteFontFileEnumeratorVtbl systemfontfileenumeratorvtbl =
systemfontfileenumerator_GetCurrentFontFile
};
static HRESULT create_system_fontfile_enumerator(IDWriteFactory3 *factory, IDWriteFontFileEnumerator **ret)
static HRESULT create_system_fontfile_enumerator(IDWriteFactory4 *factory, IDWriteFontFileEnumerator **ret)
{
struct system_fontfile_enumerator *enumerator;
static const WCHAR fontslistW[] = {
@ -3817,11 +3817,11 @@ static HRESULT create_system_fontfile_enumerator(IDWriteFactory3 *factory, IDWri
enumerator->ref = 1;
enumerator->factory = factory;
enumerator->index = -1;
IDWriteFactory3_AddRef(factory);
IDWriteFactory4_AddRef(factory);
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, fontslistW, 0, GENERIC_READ, &enumerator->hkey)) {
ERR("failed to open fonts list key\n");
IDWriteFactory3_Release(factory);
IDWriteFactory4_Release(factory);
heap_free(enumerator);
return E_FAIL;
}
@ -3831,7 +3831,7 @@ static HRESULT create_system_fontfile_enumerator(IDWriteFactory3 *factory, IDWri
return S_OK;
}
HRESULT get_system_fontcollection(IDWriteFactory3 *factory, IDWriteFontCollection1 **collection)
HRESULT get_system_fontcollection(IDWriteFactory4 *factory, IDWriteFontCollection1 **collection)
{
IDWriteFontFileEnumerator *enumerator;
HRESULT hr;
@ -3848,7 +3848,7 @@ HRESULT get_system_fontcollection(IDWriteFactory3 *factory, IDWriteFontCollectio
return hr;
}
static HRESULT eudc_collection_add_family(IDWriteFactory3 *factory, struct dwrite_fontcollection *collection,
static HRESULT eudc_collection_add_family(IDWriteFactory4 *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};
@ -3927,7 +3927,7 @@ static HRESULT eudc_collection_add_family(IDWriteFactory3 *factory, struct dwrit
return hr;
}
HRESULT get_eudc_fontcollection(IDWriteFactory3 *factory, IDWriteFontCollection **ret)
HRESULT get_eudc_fontcollection(IDWriteFactory4 *factory, IDWriteFontCollection **ret)
{
static const WCHAR eudckeyfmtW[] = {'E','U','D','C','\\','%','u',0};
struct dwrite_fontcollection *collection;
@ -5535,7 +5535,7 @@ static ULONG WINAPI fontfacereference_Release(IDWriteFontFaceReference *iface)
if (!ref) {
IDWriteFontFile_Release(This->file);
IDWriteFactory3_Release(This->factory);
IDWriteFactory4_Release(This->factory);
heap_free(This);
}
@ -5568,7 +5568,7 @@ static HRESULT WINAPI fontfacereference_CreateFontFaceWithSimulations(IDWriteFon
if (FAILED(hr))
return hr;
hr = IDWriteFactory3_CreateFontFace(This->factory, face_type, 1, &This->file, This->index, simulations, &fontface);
hr = IDWriteFactory4_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);
@ -5632,7 +5632,7 @@ static HRESULT WINAPI fontfacereference_GetFontFile(IDWriteFontFaceReference *if
if (FAILED(hr))
return hr;
hr = IDWriteFactory3_CreateCustomFontFileReference(This->factory, key, key_size, loader, file);
hr = IDWriteFactory4_CreateCustomFontFileReference(This->factory, key, key_size, loader, file);
IDWriteFontFileLoader_Release(loader);
return hr;
@ -5733,7 +5733,7 @@ static const IDWriteFontFaceReferenceVtbl fontfacereferencevtbl = {
fontfacereference_EnqueueFileFragmentDownloadRequest
};
HRESULT create_fontfacereference(IDWriteFactory3 *factory, IDWriteFontFile *file, UINT32 index,
HRESULT create_fontfacereference(IDWriteFactory4 *factory, IDWriteFontFile *file, UINT32 index,
DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFaceReference **ret)
{
struct dwrite_fontfacereference *ref;
@ -5751,7 +5751,7 @@ HRESULT create_fontfacereference(IDWriteFactory3 *factory, IDWriteFontFile *file
ref->ref = 1;
ref->factory = factory;
IDWriteFactory3_AddRef(ref->factory);
IDWriteFactory4_AddRef(ref->factory);
ref->file = file;
IDWriteFontFile_AddRef(ref->file);
ref->index = index;

View File

@ -599,14 +599,14 @@ static ULONG WINAPI gdiinterop_AddRef(IDWriteGdiInterop1 *iface)
{
struct gdiinterop *This = impl_from_IDWriteGdiInterop1(iface);
TRACE("(%p)\n", This);
return IDWriteFactory3_AddRef(This->factory);
return IDWriteFactory4_AddRef(This->factory);
}
static ULONG WINAPI gdiinterop_Release(IDWriteGdiInterop1 *iface)
{
struct gdiinterop *This = impl_from_IDWriteGdiInterop1(iface);
TRACE("(%p)\n", This);
return IDWriteFactory3_Release(This->factory);
return IDWriteFactory4_Release(This->factory);
}
static HRESULT WINAPI gdiinterop_CreateFontFromLOGFONT(IDWriteGdiInterop1 *iface,
@ -805,7 +805,7 @@ static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop1 *iface
return E_FAIL;
}
hr = IDWriteFactory3_CreateFontFileReference(This->factory, fileinfo->path, &fileinfo->writetime,
hr = IDWriteFactory4_CreateFontFileReference(This->factory, fileinfo->path, &fileinfo->writetime,
&file);
heap_free(fileinfo);
if (FAILED(hr))
@ -819,7 +819,7 @@ static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop1 *iface
}
/* Simulations flags values match DWRITE_FONT_SIMULATIONS */
hr = IDWriteFactory3_CreateFontFace(This->factory, facetype, 1, &file, info.face_index, info.simulations,
hr = IDWriteFactory4_CreateFontFace(This->factory, facetype, 1, &file, info.face_index, info.simulations,
fontface);
IDWriteFontFile_Release(file);
return hr;
@ -852,7 +852,7 @@ static HRESULT WINAPI gdiinterop1_CreateFontFromLOGFONT(IDWriteGdiInterop1 *ifac
if (collection)
IDWriteFontCollection_AddRef(collection);
else {
hr = IDWriteFactory3_GetSystemFontCollection(This->factory, FALSE, (IDWriteFontCollection1**)&collection, FALSE);
hr = IDWriteFactory4_GetSystemFontCollection(This->factory, FALSE, (IDWriteFontCollection1**)&collection, FALSE);
if (FAILED(hr)) {
ERR("failed to get system font collection: 0x%08x.\n", hr);
return hr;
@ -957,7 +957,7 @@ static const struct IDWriteGdiInterop1Vtbl gdiinteropvtbl = {
gdiinterop1_GetMatchingFontsByLOGFONT
};
void gdiinterop_init(struct gdiinterop *interop, IDWriteFactory3 *factory)
void gdiinterop_init(struct gdiinterop *interop, IDWriteFactory4 *factory)
{
interop->IDWriteGdiInterop1_iface.lpVtbl = &gdiinteropvtbl;
/* Interop is a part of a factory, sharing its refcount.

View File

@ -235,7 +235,7 @@ struct dwrite_textlayout {
IDWriteTextAnalysisSource1 IDWriteTextAnalysisSource1_iface;
LONG ref;
IDWriteFactory3 *factory;
IDWriteFactory4 *factory;
WCHAR *str;
UINT32 len;
@ -801,7 +801,7 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout)
IDWriteFontFallback_AddRef(fallback);
}
else {
hr = IDWriteFactory3_GetSystemFontFallback(layout->factory, &fallback);
hr = IDWriteFactory4_GetSystemFontFallback(layout->factory, &fallback);
if (FAILED(hr))
return hr;
}
@ -825,7 +825,7 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout)
IDWriteFontCollection_AddRef(collection);
}
else
IDWriteFactory3_GetSystemFontCollection(layout->factory, FALSE, (IDWriteFontCollection1**)&collection, FALSE);
IDWriteFactory4_GetSystemFontCollection(layout->factory, FALSE, (IDWriteFontCollection1**)&collection, FALSE);
hr = create_matching_font(collection, range->fontfamily, range->weight,
range->style, range->stretch, &font);
@ -2653,7 +2653,7 @@ static ULONG WINAPI dwritetextlayout_Release(IDWriteTextLayout3 *iface)
TRACE("(%p)->(%d)\n", This, ref);
if (!ref) {
IDWriteFactory3_Release(This->factory);
IDWriteFactory4_Release(This->factory);
free_layout_ranges_list(This);
free_layout_eruns(This);
free_layout_runs(This);
@ -4617,7 +4617,7 @@ static HRESULT init_textlayout(const struct textlayout_desc *desc, struct dwrite
layout->transform = desc->transform ? *desc->transform : identity;
layout->factory = desc->factory;
IDWriteFactory3_AddRef(layout->factory);
IDWriteFactory4_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);
@ -4778,7 +4778,7 @@ static inline BOOL is_flow_direction_vert(DWRITE_FLOW_DIRECTION direction)
(direction == DWRITE_FLOW_DIRECTION_BOTTOM_TO_TOP);
}
HRESULT create_trimmingsign(IDWriteFactory3 *factory, IDWriteTextFormat *format, IDWriteInlineObject **sign)
HRESULT create_trimmingsign(IDWriteFactory4 *factory, IDWriteTextFormat *format, IDWriteInlineObject **sign)
{
static const WCHAR ellipsisW = 0x2026;
struct dwrite_trimmingsign *This;
@ -4804,7 +4804,7 @@ HRESULT create_trimmingsign(IDWriteFactory3 *factory, IDWriteTextFormat *format,
This->IDWriteInlineObject_iface.lpVtbl = &dwritetrimmingsignvtbl;
This->ref = 1;
hr = IDWriteFactory3_CreateTextLayout(factory, &ellipsisW, 1, format, 0.0f, 0.0f, &This->layout);
hr = IDWriteFactory4_CreateTextLayout(factory, &ellipsisW, 1, format, 0.0f, 0.0f, &This->layout);
if (FAILED(hr)) {
heap_free(This);
return hr;

View File

@ -33,8 +33,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(dwrite);
static IDWriteFactory3 *shared_factory;
static void release_shared_factory(IDWriteFactory3*);
static IDWriteFactory4 *shared_factory;
static void release_shared_factory(IDWriteFactory4*);
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved)
{
@ -519,7 +519,7 @@ struct fileloader
};
struct dwritefactory {
IDWriteFactory3 IDWriteFactory3_iface;
IDWriteFactory4 IDWriteFactory4_iface;
LONG ref;
IDWriteFontCollection1 *system_collection;
@ -534,9 +534,9 @@ struct dwritefactory {
struct list file_loaders;
};
static inline struct dwritefactory *impl_from_IDWriteFactory3(IDWriteFactory3 *iface)
static inline struct dwritefactory *impl_from_IDWriteFactory4(IDWriteFactory4 *iface)
{
return CONTAINING_RECORD(iface, struct dwritefactory, IDWriteFactory3_iface);
return CONTAINING_RECORD(iface, struct dwritefactory, IDWriteFactory4_iface);
}
static void release_fontface_cache(struct list *fontfaces)
@ -584,11 +584,11 @@ static void release_dwritefactory(struct dwritefactory *factory)
heap_free(factory);
}
static void release_shared_factory(IDWriteFactory3 *iface)
static void release_shared_factory(IDWriteFactory4 *iface)
{
struct dwritefactory *factory;
if (!iface) return;
factory = impl_from_IDWriteFactory3(iface);
factory = impl_from_IDWriteFactory4(iface);
release_dwritefactory(factory);
}
@ -620,20 +620,21 @@ static struct collectionloader *factory_get_collection_loader(struct dwritefacto
return found;
}
static HRESULT WINAPI dwritefactory_QueryInterface(IDWriteFactory3 *iface, REFIID riid, void **obj)
static HRESULT WINAPI dwritefactory_QueryInterface(IDWriteFactory4 *iface, REFIID riid, void **obj)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
if (IsEqualIID(riid, &IID_IDWriteFactory3) ||
if (IsEqualIID(riid, &IID_IDWriteFactory4) ||
IsEqualIID(riid, &IID_IDWriteFactory3) ||
IsEqualIID(riid, &IID_IDWriteFactory2) ||
IsEqualIID(riid, &IID_IDWriteFactory1) ||
IsEqualIID(riid, &IID_IDWriteFactory) ||
IsEqualIID(riid, &IID_IUnknown))
{
*obj = iface;
IDWriteFactory3_AddRef(iface);
IDWriteFactory4_AddRef(iface);
return S_OK;
}
@ -642,17 +643,17 @@ static HRESULT WINAPI dwritefactory_QueryInterface(IDWriteFactory3 *iface, REFII
return E_NOINTERFACE;
}
static ULONG WINAPI dwritefactory_AddRef(IDWriteFactory3 *iface)
static ULONG WINAPI dwritefactory_AddRef(IDWriteFactory4 *iface)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p)->(%d)\n", This, ref);
return ref;
}
static ULONG WINAPI dwritefactory_Release(IDWriteFactory3 *iface)
static ULONG WINAPI dwritefactory_Release(IDWriteFactory4 *iface)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p)->(%d)\n", This, ref);
@ -663,16 +664,16 @@ static ULONG WINAPI dwritefactory_Release(IDWriteFactory3 *iface)
return ref;
}
static HRESULT WINAPI dwritefactory_GetSystemFontCollection(IDWriteFactory3 *iface,
static HRESULT WINAPI dwritefactory_GetSystemFontCollection(IDWriteFactory4 *iface,
IDWriteFontCollection **collection, BOOL check_for_updates)
{
return IDWriteFactory3_GetSystemFontCollection(iface, FALSE, (IDWriteFontCollection1**)collection, check_for_updates);
return IDWriteFactory4_GetSystemFontCollection(iface, FALSE, (IDWriteFontCollection1**)collection, check_for_updates);
}
static HRESULT WINAPI dwritefactory_CreateCustomFontCollection(IDWriteFactory3 *iface,
static HRESULT WINAPI dwritefactory_CreateCustomFontCollection(IDWriteFactory4 *iface,
IDWriteFontCollectionLoader *loader, void const *key, UINT32 key_size, IDWriteFontCollection **collection)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
IDWriteFontFileEnumerator *enumerator;
struct collectionloader *found;
HRESULT hr;
@ -697,10 +698,10 @@ static HRESULT WINAPI dwritefactory_CreateCustomFontCollection(IDWriteFactory3 *
return hr;
}
static HRESULT WINAPI dwritefactory_RegisterFontCollectionLoader(IDWriteFactory3 *iface,
static HRESULT WINAPI dwritefactory_RegisterFontCollectionLoader(IDWriteFactory4 *iface,
IDWriteFontCollectionLoader *loader)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
struct collectionloader *entry;
TRACE("(%p)->(%p)\n", This, loader);
@ -722,10 +723,10 @@ static HRESULT WINAPI dwritefactory_RegisterFontCollectionLoader(IDWriteFactory3
return S_OK;
}
static HRESULT WINAPI dwritefactory_UnregisterFontCollectionLoader(IDWriteFactory3 *iface,
static HRESULT WINAPI dwritefactory_UnregisterFontCollectionLoader(IDWriteFactory4 *iface,
IDWriteFontCollectionLoader *loader)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
struct collectionloader *found;
TRACE("(%p)->(%p)\n", This, loader);
@ -744,10 +745,10 @@ static HRESULT WINAPI dwritefactory_UnregisterFontCollectionLoader(IDWriteFactor
return S_OK;
}
static HRESULT WINAPI dwritefactory_CreateFontFileReference(IDWriteFactory3 *iface,
static HRESULT WINAPI dwritefactory_CreateFontFileReference(IDWriteFactory4 *iface,
WCHAR const *path, FILETIME const *writetime, IDWriteFontFile **font_file)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
UINT32 key_size;
HRESULT hr;
void *key;
@ -774,10 +775,10 @@ static HRESULT WINAPI dwritefactory_CreateFontFileReference(IDWriteFactory3 *ifa
return hr;
}
static HRESULT WINAPI dwritefactory_CreateCustomFontFileReference(IDWriteFactory3 *iface,
static HRESULT WINAPI dwritefactory_CreateCustomFontFileReference(IDWriteFactory4 *iface,
void const *reference_key, UINT32 key_size, IDWriteFontFileLoader *loader, IDWriteFontFile **font_file)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
TRACE("(%p)->(%p %u %p %p)\n", This, reference_key, key_size, loader, font_file);
@ -791,10 +792,10 @@ static HRESULT WINAPI dwritefactory_CreateCustomFontFileReference(IDWriteFactory
return create_font_file(loader, reference_key, key_size, font_file);
}
HRESULT factory_get_cached_fontface(IDWriteFactory3 *iface, IDWriteFontFile * const *font_files,
HRESULT factory_get_cached_fontface(IDWriteFactory4 *iface, IDWriteFontFile * const *font_files,
UINT32 index, DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFace **font_face, struct list **cached_list)
{
struct dwritefactory *factory = impl_from_IDWriteFactory3(iface);
struct dwritefactory *factory = impl_from_IDWriteFactory4(iface);
struct fontfacecached *cached;
IDWriteFontFileLoader *loader;
struct list *fontfaces;
@ -873,11 +874,11 @@ void factory_cache_fontface(struct list *fontfaces, IDWriteFontFace3 *fontface)
list_add_tail(fontfaces, &cached->entry);
}
static HRESULT WINAPI dwritefactory_CreateFontFace(IDWriteFactory3 *iface,
static HRESULT WINAPI dwritefactory_CreateFontFace(IDWriteFactory4 *iface,
DWRITE_FONT_FACE_TYPE req_facetype, UINT32 files_number, IDWriteFontFile* const* font_files,
UINT32 index, DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFace **font_face)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
DWRITE_FONT_FILE_TYPE file_type;
DWRITE_FONT_FACE_TYPE face_type;
struct fontface_desc desc;
@ -939,9 +940,9 @@ static HRESULT WINAPI dwritefactory_CreateFontFace(IDWriteFactory3 *iface,
return S_OK;
}
static HRESULT WINAPI dwritefactory_CreateRenderingParams(IDWriteFactory3 *iface, IDWriteRenderingParams **params)
static HRESULT WINAPI dwritefactory_CreateRenderingParams(IDWriteFactory4 *iface, IDWriteRenderingParams **params)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
HMONITOR monitor;
POINT pt;
@ -949,13 +950,13 @@ static HRESULT WINAPI dwritefactory_CreateRenderingParams(IDWriteFactory3 *iface
pt.x = pt.y = 0;
monitor = MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY);
return IDWriteFactory3_CreateMonitorRenderingParams(iface, monitor, params);
return IDWriteFactory4_CreateMonitorRenderingParams(iface, monitor, params);
}
static HRESULT WINAPI dwritefactory_CreateMonitorRenderingParams(IDWriteFactory3 *iface, HMONITOR monitor,
static HRESULT WINAPI dwritefactory_CreateMonitorRenderingParams(IDWriteFactory4 *iface, HMONITOR monitor,
IDWriteRenderingParams **params)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
IDWriteRenderingParams3 *params3;
static int fixme_once = 0;
HRESULT hr;
@ -965,30 +966,30 @@ static HRESULT WINAPI dwritefactory_CreateMonitorRenderingParams(IDWriteFactory3
if (!fixme_once++)
FIXME("(%p): monitor setting ignored\n", monitor);
hr = IDWriteFactory3_CreateCustomRenderingParams(iface, 0.0f, 0.0f, 1.0f, 0.0f, DWRITE_PIXEL_GEOMETRY_FLAT, DWRITE_RENDERING_MODE_DEFAULT,
hr = IDWriteFactory4_CreateCustomRenderingParams(iface, 0.0f, 0.0f, 1.0f, 0.0f, DWRITE_PIXEL_GEOMETRY_FLAT, DWRITE_RENDERING_MODE_DEFAULT,
DWRITE_GRID_FIT_MODE_DEFAULT, &params3);
*params = (IDWriteRenderingParams*)params3;
return hr;
}
static HRESULT WINAPI dwritefactory_CreateCustomRenderingParams(IDWriteFactory3 *iface, FLOAT gamma, FLOAT enhancedContrast,
static HRESULT WINAPI dwritefactory_CreateCustomRenderingParams(IDWriteFactory4 *iface, FLOAT gamma, FLOAT enhancedContrast,
FLOAT cleartype_level, DWRITE_PIXEL_GEOMETRY geometry, DWRITE_RENDERING_MODE mode, IDWriteRenderingParams **params)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
IDWriteRenderingParams3 *params3;
HRESULT hr;
TRACE("(%p)->(%f %f %f %d %d %p)\n", This, gamma, enhancedContrast, cleartype_level, geometry, mode, params);
hr = IDWriteFactory3_CreateCustomRenderingParams(iface, gamma, enhancedContrast, 1.0f, cleartype_level, geometry,
hr = IDWriteFactory4_CreateCustomRenderingParams(iface, gamma, enhancedContrast, 1.0f, cleartype_level, geometry,
mode, DWRITE_GRID_FIT_MODE_DEFAULT, &params3);
*params = (IDWriteRenderingParams*)params3;
return hr;
}
static HRESULT WINAPI dwritefactory_RegisterFontFileLoader(IDWriteFactory3 *iface, IDWriteFontFileLoader *loader)
static HRESULT WINAPI dwritefactory_RegisterFontFileLoader(IDWriteFactory4 *iface, IDWriteFontFileLoader *loader)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
struct fileloader *entry;
TRACE("(%p)->(%p)\n", This, loader);
@ -1014,9 +1015,9 @@ static HRESULT WINAPI dwritefactory_RegisterFontFileLoader(IDWriteFactory3 *ifac
return S_OK;
}
static HRESULT WINAPI dwritefactory_UnregisterFontFileLoader(IDWriteFactory3 *iface, IDWriteFontFileLoader *loader)
static HRESULT WINAPI dwritefactory_UnregisterFontFileLoader(IDWriteFactory4 *iface, IDWriteFontFileLoader *loader)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
struct fileloader *found;
TRACE("(%p)->(%p)\n", This, loader);
@ -1035,11 +1036,11 @@ static HRESULT WINAPI dwritefactory_UnregisterFontFileLoader(IDWriteFactory3 *if
return S_OK;
}
static HRESULT WINAPI dwritefactory_CreateTextFormat(IDWriteFactory3 *iface, WCHAR const* family_name,
static HRESULT WINAPI dwritefactory_CreateTextFormat(IDWriteFactory4 *iface, WCHAR const* family_name,
IDWriteFontCollection *collection, DWRITE_FONT_WEIGHT weight, DWRITE_FONT_STYLE style,
DWRITE_FONT_STRETCH stretch, FLOAT size, WCHAR const *locale, IDWriteTextFormat **format)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
IDWriteFontCollection *syscollection = NULL;
HRESULT hr;
@ -1047,7 +1048,7 @@ static HRESULT WINAPI dwritefactory_CreateTextFormat(IDWriteFactory3 *iface, WCH
size, debugstr_w(locale), format);
if (!collection) {
hr = IDWriteFactory3_GetSystemFontCollection(iface, FALSE, (IDWriteFontCollection1**)&syscollection, FALSE);
hr = IDWriteFactory4_GetSystemFontCollection(iface, FALSE, (IDWriteFontCollection1**)&syscollection, FALSE);
if (FAILED(hr))
return hr;
}
@ -1058,16 +1059,16 @@ static HRESULT WINAPI dwritefactory_CreateTextFormat(IDWriteFactory3 *iface, WCH
return hr;
}
static HRESULT WINAPI dwritefactory_CreateTypography(IDWriteFactory3 *iface, IDWriteTypography **typography)
static HRESULT WINAPI dwritefactory_CreateTypography(IDWriteFactory4 *iface, IDWriteTypography **typography)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
TRACE("(%p)->(%p)\n", This, typography);
return create_typography(typography);
}
static HRESULT WINAPI dwritefactory_GetGdiInterop(IDWriteFactory3 *iface, IDWriteGdiInterop **gdi_interop)
static HRESULT WINAPI dwritefactory_GetGdiInterop(IDWriteFactory4 *iface, IDWriteGdiInterop **gdi_interop)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
TRACE("(%p)->(%p)\n", This, gdi_interop);
@ -1076,10 +1077,10 @@ static HRESULT WINAPI dwritefactory_GetGdiInterop(IDWriteFactory3 *iface, IDWrit
return S_OK;
}
static HRESULT WINAPI dwritefactory_CreateTextLayout(IDWriteFactory3 *iface, WCHAR const* string,
static HRESULT WINAPI dwritefactory_CreateTextLayout(IDWriteFactory4 *iface, WCHAR const* string,
UINT32 length, IDWriteTextFormat *format, FLOAT max_width, FLOAT max_height, IDWriteTextLayout **layout)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
struct textlayout_desc desc;
TRACE("(%p)->(%s:%u %p %f %f %p)\n", This, debugstr_wn(string, length), length, format, max_width, max_height, layout);
@ -1097,11 +1098,11 @@ static HRESULT WINAPI dwritefactory_CreateTextLayout(IDWriteFactory3 *iface, WCH
return create_textlayout(&desc, layout);
}
static HRESULT WINAPI dwritefactory_CreateGdiCompatibleTextLayout(IDWriteFactory3 *iface, WCHAR const* string,
static HRESULT WINAPI dwritefactory_CreateGdiCompatibleTextLayout(IDWriteFactory4 *iface, WCHAR const* string,
UINT32 length, IDWriteTextFormat *format, FLOAT max_width, FLOAT max_height, FLOAT pixels_per_dip,
DWRITE_MATRIX const* transform, BOOL use_gdi_natural, IDWriteTextLayout **layout)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
struct textlayout_desc desc;
TRACE("(%p)->(%s:%u %p %f %f %f %p %d %p)\n", This, debugstr_wn(string, length), length, format, max_width, max_height,
@ -1120,34 +1121,34 @@ static HRESULT WINAPI dwritefactory_CreateGdiCompatibleTextLayout(IDWriteFactory
return create_textlayout(&desc, layout);
}
static HRESULT WINAPI dwritefactory_CreateEllipsisTrimmingSign(IDWriteFactory3 *iface, IDWriteTextFormat *format,
static HRESULT WINAPI dwritefactory_CreateEllipsisTrimmingSign(IDWriteFactory4 *iface, IDWriteTextFormat *format,
IDWriteInlineObject **trimming_sign)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
TRACE("(%p)->(%p %p)\n", This, format, trimming_sign);
return create_trimmingsign(iface, format, trimming_sign);
}
static HRESULT WINAPI dwritefactory_CreateTextAnalyzer(IDWriteFactory3 *iface, IDWriteTextAnalyzer **analyzer)
static HRESULT WINAPI dwritefactory_CreateTextAnalyzer(IDWriteFactory4 *iface, IDWriteTextAnalyzer **analyzer)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
TRACE("(%p)->(%p)\n", This, analyzer);
return get_textanalyzer(analyzer);
}
static HRESULT WINAPI dwritefactory_CreateNumberSubstitution(IDWriteFactory3 *iface, DWRITE_NUMBER_SUBSTITUTION_METHOD method,
static HRESULT WINAPI dwritefactory_CreateNumberSubstitution(IDWriteFactory4 *iface, DWRITE_NUMBER_SUBSTITUTION_METHOD method,
WCHAR const* locale, BOOL ignore_user_override, IDWriteNumberSubstitution **substitution)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
TRACE("(%p)->(%d %s %d %p)\n", This, method, debugstr_w(locale), ignore_user_override, substitution);
return create_numbersubstitution(method, locale, ignore_user_override, substitution);
}
static HRESULT WINAPI dwritefactory_CreateGlyphRunAnalysis(IDWriteFactory3 *iface, DWRITE_GLYPH_RUN const *run,
static HRESULT WINAPI dwritefactory_CreateGlyphRunAnalysis(IDWriteFactory4 *iface, DWRITE_GLYPH_RUN const *run,
FLOAT ppdip, DWRITE_MATRIX const* transform, DWRITE_RENDERING_MODE rendering_mode,
DWRITE_MEASURING_MODE measuring_mode, FLOAT originX, FLOAT originY, IDWriteGlyphRunAnalysis **analysis)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
struct glyphrunanalysis_desc desc;
TRACE("(%p)->(%p %.2f %p %d %d %.2f %.2f %p)\n", This, run, ppdip, transform, rendering_mode,
@ -1170,10 +1171,10 @@ static HRESULT WINAPI dwritefactory_CreateGlyphRunAnalysis(IDWriteFactory3 *ifac
return create_glyphrunanalysis(&desc, analysis);
}
static HRESULT WINAPI dwritefactory1_GetEudcFontCollection(IDWriteFactory3 *iface, IDWriteFontCollection **collection,
static HRESULT WINAPI dwritefactory1_GetEudcFontCollection(IDWriteFactory4 *iface, IDWriteFontCollection **collection,
BOOL check_for_updates)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
HRESULT hr = S_OK;
TRACE("(%p)->(%p %d)\n", This, collection, check_for_updates);
@ -1192,25 +1193,25 @@ static HRESULT WINAPI dwritefactory1_GetEudcFontCollection(IDWriteFactory3 *ifac
return hr;
}
static HRESULT WINAPI dwritefactory1_CreateCustomRenderingParams(IDWriteFactory3 *iface, FLOAT gamma,
static HRESULT WINAPI dwritefactory1_CreateCustomRenderingParams(IDWriteFactory4 *iface, FLOAT gamma,
FLOAT enhcontrast, FLOAT enhcontrast_grayscale, FLOAT cleartype_level, DWRITE_PIXEL_GEOMETRY geometry,
DWRITE_RENDERING_MODE mode, IDWriteRenderingParams1** params)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
IDWriteRenderingParams3 *params3;
HRESULT hr;
TRACE("(%p)->(%.2f %.2f %.2f %.2f %d %d %p)\n", This, gamma, enhcontrast, enhcontrast_grayscale,
cleartype_level, geometry, mode, params);
hr = IDWriteFactory3_CreateCustomRenderingParams(iface, gamma, enhcontrast, enhcontrast_grayscale,
hr = IDWriteFactory4_CreateCustomRenderingParams(iface, gamma, enhcontrast, enhcontrast_grayscale,
cleartype_level, geometry, mode, DWRITE_GRID_FIT_MODE_DEFAULT, &params3);
*params = (IDWriteRenderingParams1*)params3;
return hr;
}
static HRESULT WINAPI dwritefactory2_GetSystemFontFallback(IDWriteFactory3 *iface, IDWriteFontFallback **fallback)
static HRESULT WINAPI dwritefactory2_GetSystemFontFallback(IDWriteFactory4 *iface, IDWriteFontFallback **fallback)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
TRACE("(%p)->(%p)\n", This, fallback);
@ -1227,46 +1228,46 @@ static HRESULT WINAPI dwritefactory2_GetSystemFontFallback(IDWriteFactory3 *ifac
return S_OK;
}
static HRESULT WINAPI dwritefactory2_CreateFontFallbackBuilder(IDWriteFactory3 *iface, IDWriteFontFallbackBuilder **fallbackbuilder)
static HRESULT WINAPI dwritefactory2_CreateFontFallbackBuilder(IDWriteFactory4 *iface, IDWriteFontFallbackBuilder **fallbackbuilder)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
FIXME("(%p)->(%p): stub\n", This, fallbackbuilder);
return E_NOTIMPL;
}
static HRESULT WINAPI dwritefactory2_TranslateColorGlyphRun(IDWriteFactory3 *iface, FLOAT originX, FLOAT originY,
static HRESULT WINAPI dwritefactory2_TranslateColorGlyphRun(IDWriteFactory4 *iface, FLOAT originX, FLOAT originY,
const DWRITE_GLYPH_RUN *run, const DWRITE_GLYPH_RUN_DESCRIPTION *rundescr, DWRITE_MEASURING_MODE mode,
const DWRITE_MATRIX *transform, UINT32 palette, IDWriteColorGlyphRunEnumerator **colorlayers)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
TRACE("(%p)->(%.2f %.2f %p %p %d %p %u %p)\n", This, originX, originY, run, rundescr, mode,
transform, palette, colorlayers);
return create_colorglyphenum(originX, originY, run, rundescr, mode, transform, palette, colorlayers);
}
static HRESULT WINAPI dwritefactory2_CreateCustomRenderingParams(IDWriteFactory3 *iface, FLOAT gamma, FLOAT contrast,
static HRESULT WINAPI dwritefactory2_CreateCustomRenderingParams(IDWriteFactory4 *iface, FLOAT gamma, FLOAT contrast,
FLOAT grayscalecontrast, FLOAT cleartype_level, DWRITE_PIXEL_GEOMETRY geometry, DWRITE_RENDERING_MODE mode,
DWRITE_GRID_FIT_MODE gridfit, IDWriteRenderingParams2 **params)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
IDWriteRenderingParams3 *params3;
HRESULT hr;
TRACE("(%p)->(%.2f %.2f %.2f %.2f %d %d %d %p)\n", This, gamma, contrast, grayscalecontrast, cleartype_level,
geometry, mode, gridfit, params);
hr = IDWriteFactory3_CreateCustomRenderingParams(iface, gamma, contrast, grayscalecontrast,
hr = IDWriteFactory4_CreateCustomRenderingParams(iface, gamma, contrast, grayscalecontrast,
cleartype_level, geometry, mode, DWRITE_GRID_FIT_MODE_DEFAULT, &params3);
*params = (IDWriteRenderingParams2*)params3;
return hr;
}
static HRESULT WINAPI dwritefactory2_CreateGlyphRunAnalysis(IDWriteFactory3 *iface, const DWRITE_GLYPH_RUN *run,
static HRESULT WINAPI dwritefactory2_CreateGlyphRunAnalysis(IDWriteFactory4 *iface, const DWRITE_GLYPH_RUN *run,
const DWRITE_MATRIX *transform, DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEASURING_MODE measuring_mode,
DWRITE_GRID_FIT_MODE gridfit_mode, DWRITE_TEXT_ANTIALIAS_MODE aa_mode, FLOAT originX, FLOAT originY,
IDWriteGlyphRunAnalysis **analysis)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
struct glyphrunanalysis_desc desc;
TRACE("(%p)->(%p %p %d %d %d %d %.2f %.2f %p)\n", This, run, transform, rendering_mode, measuring_mode,
@ -1284,12 +1285,12 @@ static HRESULT WINAPI dwritefactory2_CreateGlyphRunAnalysis(IDWriteFactory3 *ifa
return create_glyphrunanalysis(&desc, analysis);
}
static HRESULT WINAPI dwritefactory3_CreateGlyphRunAnalysis(IDWriteFactory3 *iface, DWRITE_GLYPH_RUN const *run,
static HRESULT WINAPI dwritefactory3_CreateGlyphRunAnalysis(IDWriteFactory4 *iface, DWRITE_GLYPH_RUN const *run,
DWRITE_MATRIX const *transform, DWRITE_RENDERING_MODE1 rendering_mode, DWRITE_MEASURING_MODE measuring_mode,
DWRITE_GRID_FIT_MODE gridfit_mode, DWRITE_TEXT_ANTIALIAS_MODE aa_mode, FLOAT originX, FLOAT originY,
IDWriteGlyphRunAnalysis **analysis)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
FIXME("(%p)->(%p %p %d %d %d %d %.2f %.2f %p): stub\n", This, run, transform, rendering_mode, measuring_mode,
gridfit_mode, aa_mode, originX, originY, analysis);
@ -1297,11 +1298,11 @@ static HRESULT WINAPI dwritefactory3_CreateGlyphRunAnalysis(IDWriteFactory3 *ifa
return E_NOTIMPL;
}
static HRESULT WINAPI dwritefactory3_CreateCustomRenderingParams(IDWriteFactory3 *iface, FLOAT gamma, FLOAT contrast,
static HRESULT WINAPI dwritefactory3_CreateCustomRenderingParams(IDWriteFactory4 *iface, FLOAT gamma, FLOAT contrast,
FLOAT grayscale_contrast, FLOAT cleartype_level, DWRITE_PIXEL_GEOMETRY pixel_geometry, DWRITE_RENDERING_MODE1 rendering_mode,
DWRITE_GRID_FIT_MODE gridfit_mode, IDWriteRenderingParams3 **params)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
TRACE("(%p)->(%.2f %.2f %.2f %.2f %d %d %d %p)\n", This, gamma, contrast, grayscale_contrast, cleartype_level,
pixel_geometry, rendering_mode, gridfit_mode, params);
@ -1310,68 +1311,68 @@ static HRESULT WINAPI dwritefactory3_CreateCustomRenderingParams(IDWriteFactory3
gridfit_mode, params);
}
static HRESULT WINAPI dwritefactory3_CreateFontFaceReference_(IDWriteFactory3 *iface, IDWriteFontFile *file, UINT32 index,
static HRESULT WINAPI dwritefactory3_CreateFontFaceReference_(IDWriteFactory4 *iface, IDWriteFontFile *file, UINT32 index,
DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFaceReference **reference)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
TRACE("(%p)->(%p %u %x %p)\n", This, file, index, simulations, reference);
return create_fontfacereference(iface, file, index, simulations, reference);
}
static HRESULT WINAPI dwritefactory3_CreateFontFaceReference(IDWriteFactory3 *iface, WCHAR const *path, FILETIME const *writetime,
static HRESULT WINAPI dwritefactory3_CreateFontFaceReference(IDWriteFactory4 *iface, WCHAR const *path, FILETIME const *writetime,
UINT32 index, DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFaceReference **reference)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
IDWriteFontFile *file;
HRESULT hr;
TRACE("(%p)->(%s %p %u %x, %p)\n", This, debugstr_w(path), writetime, index, simulations, reference);
hr = IDWriteFactory3_CreateFontFileReference(iface, path, writetime, &file);
hr = IDWriteFactory4_CreateFontFileReference(iface, path, writetime, &file);
if (FAILED(hr)) {
*reference = NULL;
return hr;
}
hr = IDWriteFactory3_CreateFontFaceReference_(iface, file, index, simulations, reference);
hr = IDWriteFactory4_CreateFontFaceReference_(iface, file, index, simulations, reference);
IDWriteFontFile_Release(file);
return hr;
}
static HRESULT WINAPI dwritefactory3_GetSystemFontSet(IDWriteFactory3 *iface, IDWriteFontSet **fontset)
static HRESULT WINAPI dwritefactory3_GetSystemFontSet(IDWriteFactory4 *iface, IDWriteFontSet **fontset)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
FIXME("(%p)->(%p): stub\n", This, fontset);
return E_NOTIMPL;
}
static HRESULT WINAPI dwritefactory3_CreateFontSetBuilder(IDWriteFactory3 *iface, IDWriteFontSetBuilder **builder)
static HRESULT WINAPI dwritefactory3_CreateFontSetBuilder(IDWriteFactory4 *iface, IDWriteFontSetBuilder **builder)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
FIXME("(%p)->(%p): stub\n", This, builder);
return E_NOTIMPL;
}
static HRESULT WINAPI dwritefactory3_CreateFontCollectionFromFontSet(IDWriteFactory3 *iface, IDWriteFontSet *fontset,
static HRESULT WINAPI dwritefactory3_CreateFontCollectionFromFontSet(IDWriteFactory4 *iface, IDWriteFontSet *fontset,
IDWriteFontCollection1 **collection)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
FIXME("(%p)->(%p %p): stub\n", This, fontset, collection);
return E_NOTIMPL;
}
static HRESULT WINAPI dwritefactory3_GetSystemFontCollection(IDWriteFactory3 *iface, BOOL include_downloadable,
static HRESULT WINAPI dwritefactory3_GetSystemFontCollection(IDWriteFactory4 *iface, BOOL include_downloadable,
IDWriteFontCollection1 **collection, BOOL check_for_updates)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
HRESULT hr = S_OK;
TRACE("(%p)->(%d %p %d)\n", This, include_downloadable, collection, check_for_updates);
@ -1393,16 +1394,49 @@ static HRESULT WINAPI dwritefactory3_GetSystemFontCollection(IDWriteFactory3 *if
return hr;
}
static HRESULT WINAPI dwritefactory3_GetFontDownloadQueue(IDWriteFactory3 *iface, IDWriteFontDownloadQueue **queue)
static HRESULT WINAPI dwritefactory3_GetFontDownloadQueue(IDWriteFactory4 *iface, IDWriteFontDownloadQueue **queue)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
FIXME("(%p)->(%p): stub\n", This, queue);
return E_NOTIMPL;
}
static const struct IDWriteFactory3Vtbl dwritefactoryvtbl = {
static HRESULT WINAPI dwritefactory4_TranslateColorGlyphRun(IDWriteFactory4 *iface, D2D1_POINT_2F baseline_origin,
DWRITE_GLYPH_RUN const *run, DWRITE_GLYPH_RUN_DESCRIPTION const *run_desc, DWRITE_GLYPH_IMAGE_FORMATS desired_formats,
DWRITE_MEASURING_MODE measuring_mode, DWRITE_MATRIX const *transform, UINT32 palette, IDWriteColorGlyphRunEnumerator1 **layers)
{
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
FIXME("(%p)->(%p %p %u %d %p %u %p): stub\n", This, run, run_desc, desired_formats, measuring_mode,
transform, palette, layers);
return E_NOTIMPL;
}
static HRESULT WINAPI dwritefactory4_ComputeGlyphOrigins_(IDWriteFactory4 *iface, DWRITE_GLYPH_RUN const *run,
D2D1_POINT_2F baseline_origin, D2D1_POINT_2F *origins)
{
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
FIXME("(%p)->(%p %p): stub\n", This, run, origins);
return E_NOTIMPL;
}
static HRESULT WINAPI dwritefactory4_ComputeGlyphOrigins(IDWriteFactory4 *iface, DWRITE_GLYPH_RUN const *run,
DWRITE_MEASURING_MODE measuring_mode, D2D1_POINT_2F baseline_origin, DWRITE_MATRIX const *transform,
D2D1_POINT_2F *origins)
{
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
FIXME("(%p)->(%p %d %p %p): stub\n", This, run, measuring_mode, transform, origins);
return E_NOTIMPL;
}
static const struct IDWriteFactory4Vtbl dwritefactoryvtbl = {
dwritefactory_QueryInterface,
dwritefactory_AddRef,
dwritefactory_Release,
@ -1442,24 +1476,27 @@ static const struct IDWriteFactory3Vtbl dwritefactoryvtbl = {
dwritefactory3_CreateFontSetBuilder,
dwritefactory3_CreateFontCollectionFromFontSet,
dwritefactory3_GetSystemFontCollection,
dwritefactory3_GetFontDownloadQueue
dwritefactory3_GetFontDownloadQueue,
dwritefactory4_TranslateColorGlyphRun,
dwritefactory4_ComputeGlyphOrigins_,
dwritefactory4_ComputeGlyphOrigins
};
static ULONG WINAPI shareddwritefactory_AddRef(IDWriteFactory3 *iface)
static ULONG WINAPI shareddwritefactory_AddRef(IDWriteFactory4 *iface)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
TRACE("(%p)\n", This);
return 2;
}
static ULONG WINAPI shareddwritefactory_Release(IDWriteFactory3 *iface)
static ULONG WINAPI shareddwritefactory_Release(IDWriteFactory4 *iface)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
struct dwritefactory *This = impl_from_IDWriteFactory4(iface);
TRACE("(%p)\n", This);
return 1;
}
static const struct IDWriteFactory3Vtbl shareddwritefactoryvtbl = {
static const struct IDWriteFactory4Vtbl shareddwritefactoryvtbl = {
dwritefactory_QueryInterface,
shareddwritefactory_AddRef,
shareddwritefactory_Release,
@ -1504,12 +1541,12 @@ static const struct IDWriteFactory3Vtbl shareddwritefactoryvtbl = {
static void init_dwritefactory(struct dwritefactory *factory, DWRITE_FACTORY_TYPE type)
{
factory->IDWriteFactory3_iface.lpVtbl = type == DWRITE_FACTORY_TYPE_SHARED ? &shareddwritefactoryvtbl : &dwritefactoryvtbl;
factory->IDWriteFactory4_iface.lpVtbl = type == DWRITE_FACTORY_TYPE_SHARED ? &shareddwritefactoryvtbl : &dwritefactoryvtbl;
factory->ref = 1;
factory->localfontfileloader = NULL;
factory->system_collection = NULL;
factory->eudc_collection = NULL;
gdiinterop_init(&factory->interop, &factory->IDWriteFactory3_iface);
gdiinterop_init(&factory->interop, &factory->IDWriteFactory4_iface);
factory->fallback = NULL;
list_init(&factory->collection_loaders);
@ -1527,7 +1564,7 @@ HRESULT WINAPI DWriteCreateFactory(DWRITE_FACTORY_TYPE type, REFIID riid, IUnkno
*ret = NULL;
if (type == DWRITE_FACTORY_TYPE_SHARED && shared_factory)
return IDWriteFactory3_QueryInterface(shared_factory, riid, (void**)ret);
return IDWriteFactory4_QueryInterface(shared_factory, riid, (void**)ret);
factory = heap_alloc(sizeof(struct dwritefactory));
if (!factory) return E_OUTOFMEMORY;
@ -1535,12 +1572,12 @@ HRESULT WINAPI DWriteCreateFactory(DWRITE_FACTORY_TYPE type, REFIID riid, IUnkno
init_dwritefactory(factory, type);
if (type == DWRITE_FACTORY_TYPE_SHARED)
if (InterlockedCompareExchangePointer((void**)&shared_factory, &factory->IDWriteFactory3_iface, NULL)) {
release_shared_factory(&factory->IDWriteFactory3_iface);
return IDWriteFactory3_QueryInterface(shared_factory, riid, (void**)ret);
if (InterlockedCompareExchangePointer((void**)&shared_factory, &factory->IDWriteFactory4_iface, NULL)) {
release_shared_factory(&factory->IDWriteFactory4_iface);
return IDWriteFactory4_QueryInterface(shared_factory, riid, (void**)ret);
}
hr = IDWriteFactory3_QueryInterface(&factory->IDWriteFactory3_iface, riid, (void**)ret);
IDWriteFactory3_Release(&factory->IDWriteFactory3_iface);
hr = IDWriteFactory4_QueryInterface(&factory->IDWriteFactory4_iface, riid, (void**)ret);
IDWriteFactory4_Release(&factory->IDWriteFactory4_iface);
return hr;
}