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
85ffc36b
Commit
85ffc36b
authored
Oct 09, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Update font family object to use IDWriteFontList2.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0159812e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
43 deletions
+62
-43
font.c
dlls/dwrite/font.c
+52
-43
font.c
dlls/dwrite/tests/font.c
+10
-0
No files found.
dlls/dwrite/font.c
View file @
85ffc36b
...
...
@@ -128,7 +128,7 @@ struct dwrite_fontcollection
struct
dwrite_fontfamily
{
IDWriteFontFamily2
IDWriteFontFamily2_iface
;
IDWriteFontList
1
IDWriteFontList1
_iface
;
IDWriteFontList
2
IDWriteFontList2
_iface
;
LONG
refcount
;
struct
dwrite_fontfamily_data
*
data
;
...
...
@@ -294,9 +294,9 @@ static inline struct dwrite_fontfamily *impl_from_IDWriteFontFamily2(IDWriteFont
return
CONTAINING_RECORD
(
iface
,
struct
dwrite_fontfamily
,
IDWriteFontFamily2_iface
);
}
static
inline
struct
dwrite_fontfamily
*
impl_family_from_IDWriteFontList
1
(
IDWriteFontList1
*
iface
)
static
inline
struct
dwrite_fontfamily
*
impl_family_from_IDWriteFontList
2
(
IDWriteFontList2
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
dwrite_fontfamily
,
IDWriteFontList
1
_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
dwrite_fontfamily
,
IDWriteFontList
2
_iface
);
}
static
inline
struct
dwrite_fontcollection
*
impl_from_IDWriteFontCollection3
(
IDWriteFontCollection3
*
iface
)
...
...
@@ -2004,22 +2004,22 @@ static HRESULT WINAPI dwritefontfamily_QueryInterface(IDWriteFontFamily2 *iface,
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
*
obj
=
iface
;
IDWriteFontFamily2_AddRef
(
iface
);
return
S_OK
;
}
if
(
IsEqualIID
(
riid
,
&
IID_IDWriteFontList1
)
||
else
if
(
IsEqualIID
(
riid
,
&
IID_IDWriteFontList2
)
||
IsEqualIID
(
riid
,
&
IID_IDWriteFontList1
)
||
IsEqualIID
(
riid
,
&
IID_IDWriteFontList
))
{
*
obj
=
&
family
->
IDWriteFontList1_iface
;
IDWriteFontList1_AddRef
(
&
family
->
IDWriteFontList1_iface
);
return
S_OK
;
*
obj
=
&
family
->
IDWriteFontList2_iface
;
}
else
{
WARN
(
"%s not implemented.
\n
"
,
debugstr_guid
(
riid
));
*
obj
=
NULL
;
return
E_NOINTERFACE
;
}
WARN
(
"%s not implemented.
\n
"
,
debugstr_guid
(
riid
));
*
obj
=
NULL
;
return
E_NOINTERFACE
;
IUnknown_AddRef
((
IUnknown
*
)
*
obj
);
return
S_OK
;
}
static
ULONG
WINAPI
dwritefontfamily_AddRef
(
IDWriteFontFamily2
*
iface
)
...
...
@@ -2329,63 +2329,71 @@ static const IDWriteFontFamily2Vtbl fontfamilyvtbl =
dwritefontfamily2_GetFontSet
,
};
static
HRESULT
WINAPI
dwritefontfamilylist_QueryInterface
(
IDWriteFontList
1
*
iface
,
REFIID
riid
,
void
**
obj
)
static
HRESULT
WINAPI
dwritefontfamilylist_QueryInterface
(
IDWriteFontList
2
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
dwrite_fontfamily
*
This
=
impl_family_from_IDWriteFontList1
(
iface
);
return
dwritefontfamily_QueryInterface
(
&
This
->
IDWriteFontFamily2_iface
,
riid
,
obj
);
struct
dwrite_fontfamily
*
family
=
impl_family_from_IDWriteFontList2
(
iface
);
return
dwritefontfamily_QueryInterface
(
&
family
->
IDWriteFontFamily2_iface
,
riid
,
obj
);
}
static
ULONG
WINAPI
dwritefontfamilylist_AddRef
(
IDWriteFontList
1
*
iface
)
static
ULONG
WINAPI
dwritefontfamilylist_AddRef
(
IDWriteFontList
2
*
iface
)
{
struct
dwrite_fontfamily
*
This
=
impl_family_from_IDWriteFontList1
(
iface
);
return
dwritefontfamily_AddRef
(
&
This
->
IDWriteFontFamily2_iface
);
struct
dwrite_fontfamily
*
family
=
impl_family_from_IDWriteFontList2
(
iface
);
return
dwritefontfamily_AddRef
(
&
family
->
IDWriteFontFamily2_iface
);
}
static
ULONG
WINAPI
dwritefontfamilylist_Release
(
IDWriteFontList
1
*
iface
)
static
ULONG
WINAPI
dwritefontfamilylist_Release
(
IDWriteFontList
2
*
iface
)
{
struct
dwrite_fontfamily
*
This
=
impl_family_from_IDWriteFontList1
(
iface
);
return
dwritefontfamily_Release
(
&
This
->
IDWriteFontFamily2_iface
);
struct
dwrite_fontfamily
*
family
=
impl_family_from_IDWriteFontList2
(
iface
);
return
dwritefontfamily_Release
(
&
family
->
IDWriteFontFamily2_iface
);
}
static
HRESULT
WINAPI
dwritefontfamilylist_GetFontCollection
(
IDWriteFontList
1
*
iface
,
static
HRESULT
WINAPI
dwritefontfamilylist_GetFontCollection
(
IDWriteFontList
2
*
iface
,
IDWriteFontCollection
**
collection
)
{
struct
dwrite_fontfamily
*
This
=
impl_family_from_IDWriteFontList1
(
iface
);
return
dwritefontfamily_GetFontCollection
(
&
This
->
IDWriteFontFamily2_iface
,
collection
);
struct
dwrite_fontfamily
*
family
=
impl_family_from_IDWriteFontList2
(
iface
);
return
dwritefontfamily_GetFontCollection
(
&
family
->
IDWriteFontFamily2_iface
,
collection
);
}
static
UINT32
WINAPI
dwritefontfamilylist_GetFontCount
(
IDWriteFontList
1
*
iface
)
static
UINT32
WINAPI
dwritefontfamilylist_GetFontCount
(
IDWriteFontList
2
*
iface
)
{
struct
dwrite_fontfamily
*
This
=
impl_family_from_IDWriteFontList1
(
iface
);
return
dwritefontfamily_GetFontCount
(
&
This
->
IDWriteFontFamily2_iface
);
struct
dwrite_fontfamily
*
family
=
impl_family_from_IDWriteFontList2
(
iface
);
return
dwritefontfamily_GetFontCount
(
&
family
->
IDWriteFontFamily2_iface
);
}
static
HRESULT
WINAPI
dwritefontfamilylist_GetFont
(
IDWriteFontList
1
*
iface
,
UINT32
index
,
IDWriteFont
**
font
)
static
HRESULT
WINAPI
dwritefontfamilylist_GetFont
(
IDWriteFontList
2
*
iface
,
UINT32
index
,
IDWriteFont
**
font
)
{
struct
dwrite_fontfamily
*
This
=
impl_family_from_IDWriteFontList1
(
iface
);
return
dwritefontfamily_GetFont
(
&
This
->
IDWriteFontFamily2_iface
,
index
,
font
);
struct
dwrite_fontfamily
*
family
=
impl_family_from_IDWriteFontList2
(
iface
);
return
dwritefontfamily_GetFont
(
&
family
->
IDWriteFontFamily2_iface
,
index
,
font
);
}
static
DWRITE_LOCALITY
WINAPI
dwritefontfamilylist1_GetFontLocality
(
IDWriteFontList
1
*
iface
,
UINT32
index
)
static
DWRITE_LOCALITY
WINAPI
dwritefontfamilylist1_GetFontLocality
(
IDWriteFontList
2
*
iface
,
UINT32
index
)
{
struct
dwrite_fontfamily
*
This
=
impl_family_from_IDWriteFontList1
(
iface
);
return
dwritefontfamily1_GetFontLocality
(
&
This
->
IDWriteFontFamily2_iface
,
index
);
struct
dwrite_fontfamily
*
family
=
impl_family_from_IDWriteFontList2
(
iface
);
return
dwritefontfamily1_GetFontLocality
(
&
family
->
IDWriteFontFamily2_iface
,
index
);
}
static
HRESULT
WINAPI
dwritefontfamilylist1_GetFont
(
IDWriteFontList
1
*
iface
,
UINT32
index
,
IDWriteFont3
**
font
)
static
HRESULT
WINAPI
dwritefontfamilylist1_GetFont
(
IDWriteFontList
2
*
iface
,
UINT32
index
,
IDWriteFont3
**
font
)
{
struct
dwrite_fontfamily
*
This
=
impl_family_from_IDWriteFontList1
(
iface
);
return
dwritefontfamily1_GetFont
(
&
This
->
IDWriteFontFamily2_iface
,
index
,
font
);
struct
dwrite_fontfamily
*
family
=
impl_family_from_IDWriteFontList2
(
iface
);
return
dwritefontfamily1_GetFont
(
&
family
->
IDWriteFontFamily2_iface
,
index
,
font
);
}
static
HRESULT
WINAPI
dwritefontfamilylist1_GetFontFaceReference
(
IDWriteFontList
1
*
iface
,
UINT32
index
,
static
HRESULT
WINAPI
dwritefontfamilylist1_GetFontFaceReference
(
IDWriteFontList
2
*
iface
,
UINT32
index
,
IDWriteFontFaceReference
**
reference
)
{
struct
dwrite_fontfamily
*
This
=
impl_family_from_IDWriteFontList1
(
iface
);
return
dwritefontfamily1_GetFontFaceReference
(
&
This
->
IDWriteFontFamily2_iface
,
index
,
reference
);
struct
dwrite_fontfamily
*
family
=
impl_family_from_IDWriteFontList2
(
iface
);
return
dwritefontfamily1_GetFontFaceReference
(
&
family
->
IDWriteFontFamily2_iface
,
index
,
reference
);
}
static
HRESULT
WINAPI
dwritefontfamilylist2_GetFontSet
(
IDWriteFontList2
*
iface
,
IDWriteFontSet1
**
fontset
)
{
FIXME
(
"%p, %p.
\n
"
,
iface
,
fontset
);
return
E_NOTIMPL
;
}
static
const
IDWriteFontList1Vtbl
fontfamilylistvtbl
=
{
static
const
IDWriteFontList2Vtbl
fontfamilylistvtbl
=
{
dwritefontfamilylist_QueryInterface
,
dwritefontfamilylist_AddRef
,
dwritefontfamilylist_Release
,
...
...
@@ -2395,6 +2403,7 @@ static const IDWriteFontList1Vtbl fontfamilylistvtbl = {
dwritefontfamilylist1_GetFontLocality
,
dwritefontfamilylist1_GetFont
,
dwritefontfamilylist1_GetFontFaceReference
,
dwritefontfamilylist2_GetFontSet
,
};
static
HRESULT
create_fontfamily
(
struct
dwrite_fontcollection
*
collection
,
UINT32
index
,
...
...
@@ -2409,7 +2418,7 @@ static HRESULT create_fontfamily(struct dwrite_fontcollection *collection, UINT3
return
E_OUTOFMEMORY
;
object
->
IDWriteFontFamily2_iface
.
lpVtbl
=
&
fontfamilyvtbl
;
object
->
IDWriteFontList
1
_iface
.
lpVtbl
=
&
fontfamilylistvtbl
;
object
->
IDWriteFontList
2
_iface
.
lpVtbl
=
&
fontfamilylistvtbl
;
object
->
refcount
=
1
;
object
->
collection
=
collection
;
IDWriteFontCollection3_AddRef
(
&
collection
->
IDWriteFontCollection3_iface
);
...
...
dlls/dwrite/tests/font.c
View file @
85ffc36b
...
...
@@ -1601,6 +1601,7 @@ if (0) /* crashes on native */
if
(
hr
==
S_OK
)
{
IDWriteFontFaceReference
*
ref
,
*
ref1
;
IDWriteFontList1
*
fontlist1
;
IDWriteFontList2
*
fontlist2
;
IDWriteFontList
*
fontlist
;
IDWriteFont3
*
font3
;
IDWriteFont1
*
font1
;
...
...
@@ -1629,6 +1630,15 @@ if (0) /* crashes on native */
ok
(
fontlist
==
(
IDWriteFontList
*
)
fontlist1
,
"Unexpected interface pointer.
\n
"
);
ok
(
fontlist
!=
(
IDWriteFontList
*
)
family1
,
"Unexpected interface pointer.
\n
"
);
ok
(
fontlist
!=
(
IDWriteFontList
*
)
family
,
"Unexpected interface pointer.
\n
"
);
if
(
SUCCEEDED
(
IDWriteFontFamily1_QueryInterface
(
family1
,
&
IID_IDWriteFontList2
,
(
void
**
)
&
fontlist2
)))
{
ok
(
fontlist
==
(
IDWriteFontList
*
)
fontlist2
,
"Unexpected interface pointer.
\n
"
);
IDWriteFontList2_Release
(
fontlist2
);
}
else
win_skip
(
"IDWriteFontList2 is not supported.
\n
"
);
IDWriteFontList1_Release
(
fontlist1
);
IDWriteFontList_Release
(
fontlist
);
}
...
...
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