dwrite: Use IDWriteFactory7 for layout internally.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c95ebe7d9d
commit
7a33f48ed2
|
@ -128,7 +128,7 @@ static inline BOOL is_simulation_valid(DWRITE_FONT_SIMULATIONS simulations)
|
|||
|
||||
struct textlayout_desc
|
||||
{
|
||||
IDWriteFactory5 *factory;
|
||||
IDWriteFactory7 *factory;
|
||||
const WCHAR *string;
|
||||
UINT32 length;
|
||||
IDWriteTextFormat *format;
|
||||
|
@ -231,7 +231,8 @@ 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(IDWriteFactory5*,IDWriteTextFormat*,IDWriteInlineObject**) DECLSPEC_HIDDEN;
|
||||
extern HRESULT create_trimmingsign(IDWriteFactory7 *factory, IDWriteTextFormat *format,
|
||||
IDWriteInlineObject **sign) 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;
|
||||
|
|
|
@ -251,7 +251,7 @@ struct dwrite_textlayout
|
|||
IDWriteTextAnalysisSource1 IDWriteTextAnalysisSource1_iface;
|
||||
LONG refcount;
|
||||
|
||||
IDWriteFactory5 *factory;
|
||||
IDWriteFactory7 *factory;
|
||||
|
||||
WCHAR *str;
|
||||
UINT32 len;
|
||||
|
@ -806,7 +806,7 @@ static HRESULT layout_resolve_fonts(struct dwrite_textlayout *layout)
|
|||
struct layout_run *r;
|
||||
HRESULT hr;
|
||||
|
||||
if (FAILED(hr = IDWriteFactory5_GetSystemFontCollection(layout->factory, FALSE,
|
||||
if (FAILED(hr = IDWriteFactory5_GetSystemFontCollection((IDWriteFactory5 *)layout->factory, FALSE,
|
||||
(IDWriteFontCollection1 **)&sys_collection, FALSE))) {
|
||||
WARN("Failed to get system collection, hr %#x.\n", hr);
|
||||
return hr;
|
||||
|
@ -817,7 +817,7 @@ static HRESULT layout_resolve_fonts(struct dwrite_textlayout *layout)
|
|||
IDWriteFontFallback_AddRef(fallback);
|
||||
}
|
||||
else {
|
||||
if (FAILED(hr = IDWriteFactory5_GetSystemFontFallback(layout->factory, &fallback))) {
|
||||
if (FAILED(hr = IDWriteFactory7_GetSystemFontFallback(layout->factory, &fallback))) {
|
||||
WARN("Failed to get system fallback, hr %#x.\n", hr);
|
||||
goto fatal;
|
||||
}
|
||||
|
@ -2843,7 +2843,7 @@ static ULONG WINAPI dwritetextlayout_Release(IDWriteTextLayout4 *iface)
|
|||
|
||||
if (!refcount)
|
||||
{
|
||||
IDWriteFactory5_Release(layout->factory);
|
||||
IDWriteFactory7_Release(layout->factory);
|
||||
free_layout_ranges_list(layout);
|
||||
free_layout_eruns(layout);
|
||||
free_layout_runs(layout);
|
||||
|
@ -5204,7 +5204,7 @@ static HRESULT init_textlayout(const struct textlayout_desc *desc, struct dwrite
|
|||
layout->transform = desc->transform ? *desc->transform : identity;
|
||||
|
||||
layout->factory = desc->factory;
|
||||
IDWriteFactory5_AddRef(layout->factory);
|
||||
IDWriteFactory7_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);
|
||||
|
@ -5366,7 +5366,7 @@ static inline BOOL is_flow_direction_vert(DWRITE_FLOW_DIRECTION direction)
|
|||
(direction == DWRITE_FLOW_DIRECTION_BOTTOM_TO_TOP);
|
||||
}
|
||||
|
||||
HRESULT create_trimmingsign(IDWriteFactory5 *factory, IDWriteTextFormat *format, IDWriteInlineObject **sign)
|
||||
HRESULT create_trimmingsign(IDWriteFactory7 *factory, IDWriteTextFormat *format, IDWriteInlineObject **sign)
|
||||
{
|
||||
static const WCHAR ellipsisW = 0x2026;
|
||||
struct dwrite_trimmingsign *This;
|
||||
|
@ -5392,7 +5392,7 @@ HRESULT create_trimmingsign(IDWriteFactory5 *factory, IDWriteTextFormat *format,
|
|||
This->IDWriteInlineObject_iface.lpVtbl = &dwritetrimmingsignvtbl;
|
||||
This->ref = 1;
|
||||
|
||||
hr = IDWriteFactory5_CreateTextLayout(factory, &ellipsisW, 1, format, 0.0f, 0.0f, &This->layout);
|
||||
hr = IDWriteFactory7_CreateTextLayout(factory, &ellipsisW, 1, format, 0.0f, 0.0f, &This->layout);
|
||||
if (FAILED(hr)) {
|
||||
heap_free(This);
|
||||
return hr;
|
||||
|
|
|
@ -1171,7 +1171,7 @@ static HRESULT WINAPI dwritefactory_CreateTextLayout(IDWriteFactory7 *iface, WCH
|
|||
|
||||
TRACE("%p, %s:%u, %p, %.8e, %.8e, %p.\n", iface, debugstr_wn(string, length), length, format, max_width, max_height, layout);
|
||||
|
||||
desc.factory = (IDWriteFactory5 *)iface;
|
||||
desc.factory = iface;
|
||||
desc.string = string;
|
||||
desc.length = length;
|
||||
desc.format = format;
|
||||
|
@ -1193,7 +1193,7 @@ static HRESULT WINAPI dwritefactory_CreateGdiCompatibleTextLayout(IDWriteFactory
|
|||
TRACE("%p, %s:%u, %p, %.8e, %.8e, %.8e, %p, %d, %p.\n", iface, debugstr_wn(string, length), length, format,
|
||||
max_width, max_height, pixels_per_dip, transform, use_gdi_natural, layout);
|
||||
|
||||
desc.factory = (IDWriteFactory5 *)iface;
|
||||
desc.factory = iface;
|
||||
desc.string = string;
|
||||
desc.length = length;
|
||||
desc.format = format;
|
||||
|
@ -1211,7 +1211,7 @@ static HRESULT WINAPI dwritefactory_CreateEllipsisTrimmingSign(IDWriteFactory7 *
|
|||
{
|
||||
TRACE("%p, %p, %p.\n", iface, format, trimming_sign);
|
||||
|
||||
return create_trimmingsign((IDWriteFactory5 *)iface, format, trimming_sign);
|
||||
return create_trimmingsign(iface, format, trimming_sign);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI dwritefactory_CreateTextAnalyzer(IDWriteFactory7 *iface, IDWriteTextAnalyzer **analyzer)
|
||||
|
|
Loading…
Reference in New Issue