Commit 988cf549 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Update to IDWriteFactory4.

parent 0e5eed10
...@@ -193,7 +193,7 @@ static const struct fallback_mapping fontfallback_neutral_data[] = { ...@@ -193,7 +193,7 @@ static const struct fallback_mapping fontfallback_neutral_data[] = {
struct dwrite_fontfallback { struct dwrite_fontfallback {
IDWriteFontFallback IDWriteFontFallback_iface; IDWriteFontFallback IDWriteFontFallback_iface;
IDWriteFactory3 *factory; IDWriteFactory4 *factory;
IDWriteFontCollection1 *systemcollection; IDWriteFontCollection1 *systemcollection;
const struct fallback_mapping *mappings; const struct fallback_mapping *mappings;
UINT32 count; UINT32 count;
...@@ -1785,14 +1785,14 @@ static ULONG WINAPI fontfallback_AddRef(IDWriteFontFallback *iface) ...@@ -1785,14 +1785,14 @@ static ULONG WINAPI fontfallback_AddRef(IDWriteFontFallback *iface)
{ {
struct dwrite_fontfallback *fallback = impl_from_IDWriteFontFallback(iface); struct dwrite_fontfallback *fallback = impl_from_IDWriteFontFallback(iface);
TRACE("(%p)\n", fallback); TRACE("(%p)\n", fallback);
return IDWriteFactory3_AddRef(fallback->factory); return IDWriteFactory4_AddRef(fallback->factory);
} }
static ULONG WINAPI fontfallback_Release(IDWriteFontFallback *iface) static ULONG WINAPI fontfallback_Release(IDWriteFontFallback *iface)
{ {
struct dwrite_fontfallback *fallback = impl_from_IDWriteFontFallback(iface); struct dwrite_fontfallback *fallback = impl_from_IDWriteFontFallback(iface);
TRACE("(%p)\n", fallback); 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) static int compare_fallback_mapping(const void *a, const void *b)
...@@ -1968,7 +1968,7 @@ static const IDWriteFontFallbackVtbl fontfallbackvtbl = { ...@@ -1968,7 +1968,7 @@ static const IDWriteFontFallbackVtbl fontfallbackvtbl = {
fontfallback_MapCharacters fontfallback_MapCharacters
}; };
HRESULT create_system_fontfallback(IDWriteFactory3 *factory, IDWriteFontFallback **ret) HRESULT create_system_fontfallback(IDWriteFactory4 *factory, IDWriteFontFallback **ret)
{ {
struct dwrite_fontfallback *fallback; struct dwrite_fontfallback *fallback;
...@@ -1982,7 +1982,7 @@ HRESULT create_system_fontfallback(IDWriteFactory3 *factory, IDWriteFontFallback ...@@ -1982,7 +1982,7 @@ HRESULT create_system_fontfallback(IDWriteFactory3 *factory, IDWriteFontFallback
fallback->factory = factory; fallback->factory = factory;
fallback->mappings = fontfallback_neutral_data; fallback->mappings = fontfallback_neutral_data;
fallback->count = sizeof(fontfallback_neutral_data)/sizeof(fontfallback_neutral_data[0]); 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; *ret = &fallback->IDWriteFontFallback_iface;
return S_OK; return S_OK;
......
...@@ -121,12 +121,12 @@ static inline BOOL is_simulation_valid(DWRITE_FONT_SIMULATIONS simulations) ...@@ -121,12 +121,12 @@ static inline BOOL is_simulation_valid(DWRITE_FONT_SIMULATIONS simulations)
struct gdiinterop struct gdiinterop
{ {
IDWriteGdiInterop1 IDWriteGdiInterop1_iface; IDWriteGdiInterop1 IDWriteGdiInterop1_iface;
IDWriteFactory3 *factory; IDWriteFactory4 *factory;
}; };
struct textlayout_desc struct textlayout_desc
{ {
IDWriteFactory3 *factory; IDWriteFactory4 *factory;
const WCHAR *string; const WCHAR *string;
UINT32 length; UINT32 length;
IDWriteTextFormat *format; IDWriteTextFormat *format;
...@@ -154,7 +154,7 @@ struct glyphrunanalysis_desc ...@@ -154,7 +154,7 @@ struct glyphrunanalysis_desc
struct fontface_desc struct fontface_desc
{ {
IDWriteFactory3 *factory; IDWriteFactory4 *factory;
DWRITE_FONT_FACE_TYPE face_type; DWRITE_FONT_FACE_TYPE face_type;
IDWriteFontFile * const *files; IDWriteFontFile * const *files;
UINT32 files_number; UINT32 files_number;
...@@ -168,20 +168,20 @@ extern HRESULT create_numbersubstitution(DWRITE_NUMBER_SUBSTITUTION_METHOD,const ...@@ -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, extern HRESULT create_textformat(const WCHAR*,IDWriteFontCollection*,DWRITE_FONT_WEIGHT,DWRITE_FONT_STYLE,DWRITE_FONT_STRETCH,
FLOAT,const WCHAR*,IDWriteTextFormat**) DECLSPEC_HIDDEN; FLOAT,const WCHAR*,IDWriteTextFormat**) DECLSPEC_HIDDEN;
extern HRESULT create_textlayout(const struct textlayout_desc*,IDWriteTextLayout**) 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 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 create_localizedstrings(IDWriteLocalizedStrings**) DECLSPEC_HIDDEN;
extern HRESULT add_localizedstring(IDWriteLocalizedStrings*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN; extern HRESULT add_localizedstring(IDWriteLocalizedStrings*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN;
extern HRESULT clone_localizedstring(IDWriteLocalizedStrings *iface, IDWriteLocalizedStrings **strings) DECLSPEC_HIDDEN; extern HRESULT clone_localizedstring(IDWriteLocalizedStrings *iface, IDWriteLocalizedStrings **strings) DECLSPEC_HIDDEN;
extern void set_en_localizedstring(IDWriteLocalizedStrings*,const WCHAR*) DECLSPEC_HIDDEN; extern void set_en_localizedstring(IDWriteLocalizedStrings*,const WCHAR*) DECLSPEC_HIDDEN;
extern HRESULT get_system_fontcollection(IDWriteFactory3*,IDWriteFontCollection1**) DECLSPEC_HIDDEN; extern HRESULT get_system_fontcollection(IDWriteFactory4*,IDWriteFontCollection1**) DECLSPEC_HIDDEN;
extern HRESULT get_eudc_fontcollection(IDWriteFactory3*,IDWriteFontCollection**) DECLSPEC_HIDDEN; extern HRESULT get_eudc_fontcollection(IDWriteFactory4*,IDWriteFontCollection**) DECLSPEC_HIDDEN;
extern HRESULT get_textanalyzer(IDWriteTextAnalyzer**) 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_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_localfontfileloader(IDWriteLocalFontFileLoader** iface) DECLSPEC_HIDDEN;
extern HRESULT create_fontface(const struct fontface_desc*,IDWriteFontFace3**) 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 HRESULT create_glyphrunanalysis(const struct glyphrunanalysis_desc*,IDWriteGlyphRunAnalysis**) DECLSPEC_HIDDEN;
extern BOOL is_system_collection(IDWriteFontCollection*) DECLSPEC_HIDDEN; extern BOOL is_system_collection(IDWriteFontCollection*) DECLSPEC_HIDDEN;
extern HRESULT get_local_refkey(const WCHAR*,const FILETIME*,void**,UINT32*) 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 ...@@ -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, 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; const DWRITE_MATRIX*,UINT32,IDWriteColorGlyphRunEnumerator**) DECLSPEC_HIDDEN;
extern BOOL lb_is_newline_char(WCHAR) 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 void release_system_fontfallback(IDWriteFontFallback*) DECLSPEC_HIDDEN;
extern HRESULT create_matching_font(IDWriteFontCollection*,const WCHAR*,DWRITE_FONT_WEIGHT,DWRITE_FONT_STYLE,DWRITE_FONT_STRETCH, extern HRESULT create_matching_font(IDWriteFontCollection*,const WCHAR*,DWRITE_FONT_WEIGHT,DWRITE_FONT_STYLE,DWRITE_FONT_STRETCH,
IDWriteFont**) DECLSPEC_HIDDEN; 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; 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; struct list**) DECLSPEC_HIDDEN;
extern void factory_cache_fontface(struct list*,IDWriteFontFace3*) DECLSPEC_HIDDEN; extern void factory_cache_fontface(struct list*,IDWriteFontFace3*) DECLSPEC_HIDDEN;
......
...@@ -81,7 +81,7 @@ struct dwrite_font_data { ...@@ -81,7 +81,7 @@ struct dwrite_font_data {
IDWriteLocalizedStrings *names; IDWriteLocalizedStrings *names;
/* data needed to create fontface instance */ /* data needed to create fontface instance */
IDWriteFactory3 *factory; IDWriteFactory4 *factory;
DWRITE_FONT_FACE_TYPE face_type; DWRITE_FONT_FACE_TYPE face_type;
IDWriteFontFile *file; IDWriteFontFile *file;
UINT32 face_index; UINT32 face_index;
...@@ -258,7 +258,7 @@ struct dwrite_fontfacereference { ...@@ -258,7 +258,7 @@ struct dwrite_fontfacereference {
IDWriteFontFile *file; IDWriteFontFile *file;
UINT32 index; UINT32 index;
USHORT simulations; USHORT simulations;
IDWriteFactory3 *factory; IDWriteFactory4 *factory;
}; };
static inline struct dwrite_fontface *impl_from_IDWriteFontFace3(IDWriteFontFace3 *iface) static inline struct dwrite_fontface *impl_from_IDWriteFontFace3(IDWriteFontFace3 *iface)
...@@ -414,7 +414,7 @@ static void release_font_data(struct dwrite_font_data *data) ...@@ -414,7 +414,7 @@ static void release_font_data(struct dwrite_font_data *data)
IDWriteLocalizedStrings_Release(data->names); IDWriteLocalizedStrings_Release(data->names);
IDWriteFontFile_Release(data->file); IDWriteFontFile_Release(data->file);
IDWriteFactory3_Release(data->factory); IDWriteFactory4_Release(data->factory);
heap_free(data->facename); heap_free(data->facename);
heap_free(data); heap_free(data);
} }
...@@ -1589,7 +1589,7 @@ static HRESULT WINAPI dwritefont3_GetFontFaceReference(IDWriteFont3 *iface, IDWr ...@@ -1589,7 +1589,7 @@ static HRESULT WINAPI dwritefont3_GetFontFaceReference(IDWriteFont3 *iface, IDWr
TRACE("(%p)->(%p)\n", This, reference); 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); This->data->simulations, reference);
} }
...@@ -3188,7 +3188,7 @@ static HRESULT init_font_data(const struct fontface_desc *desc, IDWriteLocalized ...@@ -3188,7 +3188,7 @@ static HRESULT init_font_data(const struct fontface_desc *desc, IDWriteLocalized
data->bold_sim_tested = 0; data->bold_sim_tested = 0;
data->oblique_sim_tested = 0; data->oblique_sim_tested = 0;
IDWriteFontFile_AddRef(data->file); IDWriteFontFile_AddRef(data->file);
IDWriteFactory3_AddRef(data->factory); IDWriteFactory4_AddRef(data->factory);
stream_desc.stream = stream; stream_desc.stream = stream;
stream_desc.face_type = desc->face_type; 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 ...@@ -3243,7 +3243,7 @@ static HRESULT init_font_data_from_font(const struct dwrite_font_data *src, DWRI
data->style = DWRITE_FONT_STYLE_OBLIQUE; data->style = DWRITE_FONT_STYLE_OBLIQUE;
memset(data->info_strings, 0, sizeof(data->info_strings)); memset(data->info_strings, 0, sizeof(data->info_strings));
data->names = NULL; data->names = NULL;
IDWriteFactory3_AddRef(data->factory); IDWriteFactory4_AddRef(data->factory);
IDWriteFontFile_AddRef(data->file); IDWriteFontFile_AddRef(data->file);
create_localizedstrings(&data->names); create_localizedstrings(&data->names);
...@@ -3499,7 +3499,7 @@ static void fontcollection_add_replacements(struct dwrite_fontcollection *collec ...@@ -3499,7 +3499,7 @@ static void fontcollection_add_replacements(struct dwrite_fontcollection *collec
RegCloseKey(hkey); 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) IDWriteFontCollection1 **ret)
{ {
struct fontfile_enum { struct fontfile_enum {
...@@ -3651,7 +3651,7 @@ struct system_fontfile_enumerator ...@@ -3651,7 +3651,7 @@ struct system_fontfile_enumerator
IDWriteFontFileEnumerator IDWriteFontFileEnumerator_iface; IDWriteFontFileEnumerator IDWriteFontFileEnumerator_iface;
LONG ref; LONG ref;
IDWriteFactory3 *factory; IDWriteFactory4 *factory;
HKEY hkey; HKEY hkey;
int index; int index;
}; };
...@@ -3686,7 +3686,7 @@ static ULONG WINAPI systemfontfileenumerator_Release(IDWriteFontFileEnumerator * ...@@ -3686,7 +3686,7 @@ static ULONG WINAPI systemfontfileenumerator_Release(IDWriteFontFileEnumerator *
ULONG ref = InterlockedDecrement(&enumerator->ref); ULONG ref = InterlockedDecrement(&enumerator->ref);
if (!ref) { if (!ref) {
IDWriteFactory3_Release(enumerator->factory); IDWriteFactory4_Release(enumerator->factory);
RegCloseKey(enumerator->hkey); RegCloseKey(enumerator->hkey);
heap_free(enumerator); heap_free(enumerator);
} }
...@@ -3694,7 +3694,7 @@ static ULONG WINAPI systemfontfileenumerator_Release(IDWriteFontFileEnumerator * ...@@ -3694,7 +3694,7 @@ static ULONG WINAPI systemfontfileenumerator_Release(IDWriteFontFileEnumerator *
return ref; 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; HRESULT hr;
...@@ -3707,10 +3707,10 @@ static HRESULT create_local_file_reference(IDWriteFactory3 *factory, const WCHAR ...@@ -3707,10 +3707,10 @@ static HRESULT create_local_file_reference(IDWriteFactory3 *factory, const WCHAR
strcatW(fullpathW, fontsW); strcatW(fullpathW, fontsW);
strcatW(fullpathW, filename); strcatW(fullpathW, filename);
hr = IDWriteFactory3_CreateFontFileReference(factory, fullpathW, NULL, file); hr = IDWriteFactory4_CreateFontFileReference(factory, fullpathW, NULL, file);
} }
else else
hr = IDWriteFactory3_CreateFontFileReference(factory, filename, NULL, file); hr = IDWriteFactory4_CreateFontFileReference(factory, filename, NULL, file);
return hr; return hr;
} }
...@@ -3798,7 +3798,7 @@ static const struct IDWriteFontFileEnumeratorVtbl systemfontfileenumeratorvtbl = ...@@ -3798,7 +3798,7 @@ static const struct IDWriteFontFileEnumeratorVtbl systemfontfileenumeratorvtbl =
systemfontfileenumerator_GetCurrentFontFile 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; struct system_fontfile_enumerator *enumerator;
static const WCHAR fontslistW[] = { static const WCHAR fontslistW[] = {
...@@ -3817,11 +3817,11 @@ static HRESULT create_system_fontfile_enumerator(IDWriteFactory3 *factory, IDWri ...@@ -3817,11 +3817,11 @@ static HRESULT create_system_fontfile_enumerator(IDWriteFactory3 *factory, IDWri
enumerator->ref = 1; enumerator->ref = 1;
enumerator->factory = factory; enumerator->factory = factory;
enumerator->index = -1; enumerator->index = -1;
IDWriteFactory3_AddRef(factory); IDWriteFactory4_AddRef(factory);
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, fontslistW, 0, GENERIC_READ, &enumerator->hkey)) { if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, fontslistW, 0, GENERIC_READ, &enumerator->hkey)) {
ERR("failed to open fonts list key\n"); ERR("failed to open fonts list key\n");
IDWriteFactory3_Release(factory); IDWriteFactory4_Release(factory);
heap_free(enumerator); heap_free(enumerator);
return E_FAIL; return E_FAIL;
} }
...@@ -3831,7 +3831,7 @@ static HRESULT create_system_fontfile_enumerator(IDWriteFactory3 *factory, IDWri ...@@ -3831,7 +3831,7 @@ static HRESULT create_system_fontfile_enumerator(IDWriteFactory3 *factory, IDWri
return S_OK; return S_OK;
} }
HRESULT get_system_fontcollection(IDWriteFactory3 *factory, IDWriteFontCollection1 **collection) HRESULT get_system_fontcollection(IDWriteFactory4 *factory, IDWriteFontCollection1 **collection)
{ {
IDWriteFontFileEnumerator *enumerator; IDWriteFontFileEnumerator *enumerator;
HRESULT hr; HRESULT hr;
...@@ -3848,7 +3848,7 @@ HRESULT get_system_fontcollection(IDWriteFactory3 *factory, IDWriteFontCollectio ...@@ -3848,7 +3848,7 @@ HRESULT get_system_fontcollection(IDWriteFactory3 *factory, IDWriteFontCollectio
return hr; 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) 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}; 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 ...@@ -3927,7 +3927,7 @@ static HRESULT eudc_collection_add_family(IDWriteFactory3 *factory, struct dwrit
return hr; 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}; static const WCHAR eudckeyfmtW[] = {'E','U','D','C','\\','%','u',0};
struct dwrite_fontcollection *collection; struct dwrite_fontcollection *collection;
...@@ -5535,7 +5535,7 @@ static ULONG WINAPI fontfacereference_Release(IDWriteFontFaceReference *iface) ...@@ -5535,7 +5535,7 @@ static ULONG WINAPI fontfacereference_Release(IDWriteFontFaceReference *iface)
if (!ref) { if (!ref) {
IDWriteFontFile_Release(This->file); IDWriteFontFile_Release(This->file);
IDWriteFactory3_Release(This->factory); IDWriteFactory4_Release(This->factory);
heap_free(This); heap_free(This);
} }
...@@ -5568,7 +5568,7 @@ static HRESULT WINAPI fontfacereference_CreateFontFaceWithSimulations(IDWriteFon ...@@ -5568,7 +5568,7 @@ static HRESULT WINAPI fontfacereference_CreateFontFaceWithSimulations(IDWriteFon
if (FAILED(hr)) if (FAILED(hr))
return 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)) { if (SUCCEEDED(hr)) {
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (void**)ret); hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (void**)ret);
IDWriteFontFace_Release(fontface); IDWriteFontFace_Release(fontface);
...@@ -5632,7 +5632,7 @@ static HRESULT WINAPI fontfacereference_GetFontFile(IDWriteFontFaceReference *if ...@@ -5632,7 +5632,7 @@ static HRESULT WINAPI fontfacereference_GetFontFile(IDWriteFontFaceReference *if
if (FAILED(hr)) if (FAILED(hr))
return 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); IDWriteFontFileLoader_Release(loader);
return hr; return hr;
...@@ -5733,7 +5733,7 @@ static const IDWriteFontFaceReferenceVtbl fontfacereferencevtbl = { ...@@ -5733,7 +5733,7 @@ static const IDWriteFontFaceReferenceVtbl fontfacereferencevtbl = {
fontfacereference_EnqueueFileFragmentDownloadRequest 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) DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFaceReference **ret)
{ {
struct dwrite_fontfacereference *ref; struct dwrite_fontfacereference *ref;
...@@ -5751,7 +5751,7 @@ HRESULT create_fontfacereference(IDWriteFactory3 *factory, IDWriteFontFile *file ...@@ -5751,7 +5751,7 @@ HRESULT create_fontfacereference(IDWriteFactory3 *factory, IDWriteFontFile *file
ref->ref = 1; ref->ref = 1;
ref->factory = factory; ref->factory = factory;
IDWriteFactory3_AddRef(ref->factory); IDWriteFactory4_AddRef(ref->factory);
ref->file = file; ref->file = file;
IDWriteFontFile_AddRef(ref->file); IDWriteFontFile_AddRef(ref->file);
ref->index = index; ref->index = index;
......
...@@ -599,14 +599,14 @@ static ULONG WINAPI gdiinterop_AddRef(IDWriteGdiInterop1 *iface) ...@@ -599,14 +599,14 @@ static ULONG WINAPI gdiinterop_AddRef(IDWriteGdiInterop1 *iface)
{ {
struct gdiinterop *This = impl_from_IDWriteGdiInterop1(iface); struct gdiinterop *This = impl_from_IDWriteGdiInterop1(iface);
TRACE("(%p)\n", This); TRACE("(%p)\n", This);
return IDWriteFactory3_AddRef(This->factory); return IDWriteFactory4_AddRef(This->factory);
} }
static ULONG WINAPI gdiinterop_Release(IDWriteGdiInterop1 *iface) static ULONG WINAPI gdiinterop_Release(IDWriteGdiInterop1 *iface)
{ {
struct gdiinterop *This = impl_from_IDWriteGdiInterop1(iface); struct gdiinterop *This = impl_from_IDWriteGdiInterop1(iface);
TRACE("(%p)\n", This); TRACE("(%p)\n", This);
return IDWriteFactory3_Release(This->factory); return IDWriteFactory4_Release(This->factory);
} }
static HRESULT WINAPI gdiinterop_CreateFontFromLOGFONT(IDWriteGdiInterop1 *iface, static HRESULT WINAPI gdiinterop_CreateFontFromLOGFONT(IDWriteGdiInterop1 *iface,
...@@ -805,7 +805,7 @@ static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop1 *iface ...@@ -805,7 +805,7 @@ static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop1 *iface
return E_FAIL; return E_FAIL;
} }
hr = IDWriteFactory3_CreateFontFileReference(This->factory, fileinfo->path, &fileinfo->writetime, hr = IDWriteFactory4_CreateFontFileReference(This->factory, fileinfo->path, &fileinfo->writetime,
&file); &file);
heap_free(fileinfo); heap_free(fileinfo);
if (FAILED(hr)) if (FAILED(hr))
...@@ -819,7 +819,7 @@ static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop1 *iface ...@@ -819,7 +819,7 @@ static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop1 *iface
} }
/* Simulations flags values match DWRITE_FONT_SIMULATIONS */ /* 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); fontface);
IDWriteFontFile_Release(file); IDWriteFontFile_Release(file);
return hr; return hr;
...@@ -852,7 +852,7 @@ static HRESULT WINAPI gdiinterop1_CreateFontFromLOGFONT(IDWriteGdiInterop1 *ifac ...@@ -852,7 +852,7 @@ static HRESULT WINAPI gdiinterop1_CreateFontFromLOGFONT(IDWriteGdiInterop1 *ifac
if (collection) if (collection)
IDWriteFontCollection_AddRef(collection); IDWriteFontCollection_AddRef(collection);
else { else {
hr = IDWriteFactory3_GetSystemFontCollection(This->factory, FALSE, (IDWriteFontCollection1**)&collection, FALSE); hr = IDWriteFactory4_GetSystemFontCollection(This->factory, FALSE, (IDWriteFontCollection1**)&collection, FALSE);
if (FAILED(hr)) { if (FAILED(hr)) {
ERR("failed to get system font collection: 0x%08x.\n", hr); ERR("failed to get system font collection: 0x%08x.\n", hr);
return hr; return hr;
...@@ -957,7 +957,7 @@ static const struct IDWriteGdiInterop1Vtbl gdiinteropvtbl = { ...@@ -957,7 +957,7 @@ static const struct IDWriteGdiInterop1Vtbl gdiinteropvtbl = {
gdiinterop1_GetMatchingFontsByLOGFONT gdiinterop1_GetMatchingFontsByLOGFONT
}; };
void gdiinterop_init(struct gdiinterop *interop, IDWriteFactory3 *factory) void gdiinterop_init(struct gdiinterop *interop, IDWriteFactory4 *factory)
{ {
interop->IDWriteGdiInterop1_iface.lpVtbl = &gdiinteropvtbl; interop->IDWriteGdiInterop1_iface.lpVtbl = &gdiinteropvtbl;
/* Interop is a part of a factory, sharing its refcount. /* Interop is a part of a factory, sharing its refcount.
......
...@@ -235,7 +235,7 @@ struct dwrite_textlayout { ...@@ -235,7 +235,7 @@ struct dwrite_textlayout {
IDWriteTextAnalysisSource1 IDWriteTextAnalysisSource1_iface; IDWriteTextAnalysisSource1 IDWriteTextAnalysisSource1_iface;
LONG ref; LONG ref;
IDWriteFactory3 *factory; IDWriteFactory4 *factory;
WCHAR *str; WCHAR *str;
UINT32 len; UINT32 len;
...@@ -801,7 +801,7 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout) ...@@ -801,7 +801,7 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout)
IDWriteFontFallback_AddRef(fallback); IDWriteFontFallback_AddRef(fallback);
} }
else { else {
hr = IDWriteFactory3_GetSystemFontFallback(layout->factory, &fallback); hr = IDWriteFactory4_GetSystemFontFallback(layout->factory, &fallback);
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
} }
...@@ -825,7 +825,7 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout) ...@@ -825,7 +825,7 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout)
IDWriteFontCollection_AddRef(collection); IDWriteFontCollection_AddRef(collection);
} }
else 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, hr = create_matching_font(collection, range->fontfamily, range->weight,
range->style, range->stretch, &font); range->style, range->stretch, &font);
...@@ -2653,7 +2653,7 @@ static ULONG WINAPI dwritetextlayout_Release(IDWriteTextLayout3 *iface) ...@@ -2653,7 +2653,7 @@ static ULONG WINAPI dwritetextlayout_Release(IDWriteTextLayout3 *iface)
TRACE("(%p)->(%d)\n", This, ref); TRACE("(%p)->(%d)\n", This, ref);
if (!ref) { if (!ref) {
IDWriteFactory3_Release(This->factory); IDWriteFactory4_Release(This->factory);
free_layout_ranges_list(This); free_layout_ranges_list(This);
free_layout_eruns(This); free_layout_eruns(This);
free_layout_runs(This); free_layout_runs(This);
...@@ -4617,7 +4617,7 @@ static HRESULT init_textlayout(const struct textlayout_desc *desc, struct dwrite ...@@ -4617,7 +4617,7 @@ static HRESULT init_textlayout(const struct textlayout_desc *desc, struct dwrite
layout->transform = desc->transform ? *desc->transform : identity; layout->transform = desc->transform ? *desc->transform : identity;
layout->factory = desc->factory; layout->factory = desc->factory;
IDWriteFactory3_AddRef(layout->factory); IDWriteFactory4_AddRef(layout->factory);
list_add_head(&layout->ranges, &range->entry); list_add_head(&layout->ranges, &range->entry);
list_add_head(&layout->strike_ranges, &strike->entry); list_add_head(&layout->strike_ranges, &strike->entry);
list_add_head(&layout->underline_ranges, &underline->entry); list_add_head(&layout->underline_ranges, &underline->entry);
...@@ -4778,7 +4778,7 @@ static inline BOOL is_flow_direction_vert(DWRITE_FLOW_DIRECTION direction) ...@@ -4778,7 +4778,7 @@ static inline BOOL is_flow_direction_vert(DWRITE_FLOW_DIRECTION direction)
(direction == DWRITE_FLOW_DIRECTION_BOTTOM_TO_TOP); (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; static const WCHAR ellipsisW = 0x2026;
struct dwrite_trimmingsign *This; struct dwrite_trimmingsign *This;
...@@ -4804,7 +4804,7 @@ HRESULT create_trimmingsign(IDWriteFactory3 *factory, IDWriteTextFormat *format, ...@@ -4804,7 +4804,7 @@ HRESULT create_trimmingsign(IDWriteFactory3 *factory, IDWriteTextFormat *format,
This->IDWriteInlineObject_iface.lpVtbl = &dwritetrimmingsignvtbl; This->IDWriteInlineObject_iface.lpVtbl = &dwritetrimmingsignvtbl;
This->ref = 1; 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)) { if (FAILED(hr)) {
heap_free(This); heap_free(This);
return hr; return hr;
......
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