Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
7a33f48e
Commit
7a33f48e
authored
Dec 05, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Use IDWriteFactory7 for layout internally.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c95ebe7d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
12 deletions
+13
-12
dwrite_private.h
dlls/dwrite/dwrite_private.h
+3
-2
layout.c
dlls/dwrite/layout.c
+7
-7
main.c
dlls/dwrite/main.c
+3
-3
No files found.
dlls/dwrite/dwrite_private.h
View file @
7a33f48e
...
@@ -128,7 +128,7 @@ static inline BOOL is_simulation_valid(DWRITE_FONT_SIMULATIONS simulations)
...
@@ -128,7 +128,7 @@ static inline BOOL is_simulation_valid(DWRITE_FONT_SIMULATIONS simulations)
struct
textlayout_desc
struct
textlayout_desc
{
{
IDWriteFactory
5
*
factory
;
IDWriteFactory
7
*
factory
;
const
WCHAR
*
string
;
const
WCHAR
*
string
;
UINT32
length
;
UINT32
length
;
IDWriteTextFormat
*
format
;
IDWriteTextFormat
*
format
;
...
@@ -231,7 +231,8 @@ extern HRESULT create_numbersubstitution(DWRITE_NUMBER_SUBSTITUTION_METHOD,const
...
@@ -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
,
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
(
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_typography
(
IDWriteTypography
**
)
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
;
...
...
dlls/dwrite/layout.c
View file @
7a33f48e
...
@@ -251,7 +251,7 @@ struct dwrite_textlayout
...
@@ -251,7 +251,7 @@ struct dwrite_textlayout
IDWriteTextAnalysisSource1
IDWriteTextAnalysisSource1_iface
;
IDWriteTextAnalysisSource1
IDWriteTextAnalysisSource1_iface
;
LONG
refcount
;
LONG
refcount
;
IDWriteFactory
5
*
factory
;
IDWriteFactory
7
*
factory
;
WCHAR
*
str
;
WCHAR
*
str
;
UINT32
len
;
UINT32
len
;
...
@@ -806,7 +806,7 @@ static HRESULT layout_resolve_fonts(struct dwrite_textlayout *layout)
...
@@ -806,7 +806,7 @@ static HRESULT layout_resolve_fonts(struct dwrite_textlayout *layout)
struct
layout_run
*
r
;
struct
layout_run
*
r
;
HRESULT
hr
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
IDWriteFactory5_GetSystemFontCollection
(
layout
->
factory
,
FALSE
,
if
(
FAILED
(
hr
=
IDWriteFactory5_GetSystemFontCollection
(
(
IDWriteFactory5
*
)
layout
->
factory
,
FALSE
,
(
IDWriteFontCollection1
**
)
&
sys_collection
,
FALSE
)))
{
(
IDWriteFontCollection1
**
)
&
sys_collection
,
FALSE
)))
{
WARN
(
"Failed to get system collection, hr %#x.
\n
"
,
hr
);
WARN
(
"Failed to get system collection, hr %#x.
\n
"
,
hr
);
return
hr
;
return
hr
;
...
@@ -817,7 +817,7 @@ static HRESULT layout_resolve_fonts(struct dwrite_textlayout *layout)
...
@@ -817,7 +817,7 @@ static HRESULT layout_resolve_fonts(struct dwrite_textlayout *layout)
IDWriteFontFallback_AddRef
(
fallback
);
IDWriteFontFallback_AddRef
(
fallback
);
}
}
else
{
else
{
if
(
FAILED
(
hr
=
IDWriteFactory
5
_GetSystemFontFallback
(
layout
->
factory
,
&
fallback
)))
{
if
(
FAILED
(
hr
=
IDWriteFactory
7
_GetSystemFontFallback
(
layout
->
factory
,
&
fallback
)))
{
WARN
(
"Failed to get system fallback, hr %#x.
\n
"
,
hr
);
WARN
(
"Failed to get system fallback, hr %#x.
\n
"
,
hr
);
goto
fatal
;
goto
fatal
;
}
}
...
@@ -2843,7 +2843,7 @@ static ULONG WINAPI dwritetextlayout_Release(IDWriteTextLayout4 *iface)
...
@@ -2843,7 +2843,7 @@ static ULONG WINAPI dwritetextlayout_Release(IDWriteTextLayout4 *iface)
if
(
!
refcount
)
if
(
!
refcount
)
{
{
IDWriteFactory
5
_Release
(
layout
->
factory
);
IDWriteFactory
7
_Release
(
layout
->
factory
);
free_layout_ranges_list
(
layout
);
free_layout_ranges_list
(
layout
);
free_layout_eruns
(
layout
);
free_layout_eruns
(
layout
);
free_layout_runs
(
layout
);
free_layout_runs
(
layout
);
...
@@ -5204,7 +5204,7 @@ static HRESULT init_textlayout(const struct textlayout_desc *desc, struct dwrite
...
@@ -5204,7 +5204,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
;
IDWriteFactory
5
_AddRef
(
layout
->
factory
);
IDWriteFactory
7
_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
);
...
@@ -5366,7 +5366,7 @@ static inline BOOL is_flow_direction_vert(DWRITE_FLOW_DIRECTION direction)
...
@@ -5366,7 +5366,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
(
IDWriteFactory
5
*
factory
,
IDWriteTextFormat
*
format
,
IDWriteInlineObject
**
sign
)
HRESULT
create_trimmingsign
(
IDWriteFactory
7
*
factory
,
IDWriteTextFormat
*
format
,
IDWriteInlineObject
**
sign
)
{
{
static
const
WCHAR
ellipsisW
=
0x2026
;
static
const
WCHAR
ellipsisW
=
0x2026
;
struct
dwrite_trimmingsign
*
This
;
struct
dwrite_trimmingsign
*
This
;
...
@@ -5392,7 +5392,7 @@ HRESULT create_trimmingsign(IDWriteFactory5 *factory, IDWriteTextFormat *format,
...
@@ -5392,7 +5392,7 @@ HRESULT create_trimmingsign(IDWriteFactory5 *factory, IDWriteTextFormat *format,
This
->
IDWriteInlineObject_iface
.
lpVtbl
=
&
dwritetrimmingsignvtbl
;
This
->
IDWriteInlineObject_iface
.
lpVtbl
=
&
dwritetrimmingsignvtbl
;
This
->
ref
=
1
;
This
->
ref
=
1
;
hr
=
IDWriteFactory
5
_CreateTextLayout
(
factory
,
&
ellipsisW
,
1
,
format
,
0
.
0
f
,
0
.
0
f
,
&
This
->
layout
);
hr
=
IDWriteFactory
7
_CreateTextLayout
(
factory
,
&
ellipsisW
,
1
,
format
,
0
.
0
f
,
0
.
0
f
,
&
This
->
layout
);
if
(
FAILED
(
hr
))
{
if
(
FAILED
(
hr
))
{
heap_free
(
This
);
heap_free
(
This
);
return
hr
;
return
hr
;
...
...
dlls/dwrite/main.c
View file @
7a33f48e
...
@@ -1171,7 +1171,7 @@ static HRESULT WINAPI dwritefactory_CreateTextLayout(IDWriteFactory7 *iface, WCH
...
@@ -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
);
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
.
string
=
string
;
desc
.
length
=
length
;
desc
.
length
=
length
;
desc
.
format
=
format
;
desc
.
format
=
format
;
...
@@ -1193,7 +1193,7 @@ static HRESULT WINAPI dwritefactory_CreateGdiCompatibleTextLayout(IDWriteFactory
...
@@ -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
,
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
);
max_width
,
max_height
,
pixels_per_dip
,
transform
,
use_gdi_natural
,
layout
);
desc
.
factory
=
(
IDWriteFactory5
*
)
iface
;
desc
.
factory
=
iface
;
desc
.
string
=
string
;
desc
.
string
=
string
;
desc
.
length
=
length
;
desc
.
length
=
length
;
desc
.
format
=
format
;
desc
.
format
=
format
;
...
@@ -1211,7 +1211,7 @@ static HRESULT WINAPI dwritefactory_CreateEllipsisTrimmingSign(IDWriteFactory7 *
...
@@ -1211,7 +1211,7 @@ static HRESULT WINAPI dwritefactory_CreateEllipsisTrimmingSign(IDWriteFactory7 *
{
{
TRACE
(
"%p, %p, %p.
\n
"
,
iface
,
format
,
trimming_sign
);
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
)
static
HRESULT
WINAPI
dwritefactory_CreateTextAnalyzer
(
IDWriteFactory7
*
iface
,
IDWriteTextAnalyzer
**
analyzer
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment