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
98ce55c1
Commit
98ce55c1
authored
Oct 07, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Add family name to string array.
parent
41df37f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
5 deletions
+63
-5
dwrite_private.h
dlls/dwrite/dwrite_private.h
+11
-0
font.c
dlls/dwrite/font.c
+8
-2
main.c
dlls/dwrite/main.c
+44
-3
No files found.
dlls/dwrite/dwrite_private.h
View file @
98ce55c1
...
...
@@ -23,6 +23,16 @@ static inline void *heap_alloc(size_t len)
return
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
}
static
inline
void
*
heap_alloc_zero
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len
);
}
static
inline
void
*
heap_realloc
(
void
*
mem
,
size_t
len
)
{
return
HeapReAlloc
(
GetProcessHeap
(),
0
,
mem
,
len
);
}
static
inline
BOOL
heap_free
(
void
*
mem
)
{
return
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
...
...
@@ -47,3 +57,4 @@ extern HRESULT create_font_from_logfont(const LOGFONTW*, IDWriteFont**) DECLSPEC
extern
HRESULT
create_textlayout
(
IDWriteTextLayout
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_gdiinterop
(
IDWriteGdiInterop
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_localizedstrings
(
IDWriteLocalizedStrings
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
add_localizedstring
(
IDWriteLocalizedStrings
*
,
const
WCHAR
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
dlls/dwrite/font.c
View file @
98ce55c1
...
...
@@ -471,9 +471,15 @@ static HRESULT WINAPI dwritefontfamily_GetFont(IDWriteFontFamily *iface, UINT32
static
HRESULT
WINAPI
dwritefontfamily_GetFamilyNames
(
IDWriteFontFamily
*
iface
,
IDWriteLocalizedStrings
**
names
)
{
struct
dwrite_fontfamily
*
This
=
impl_from_IDWriteFontFamily
(
iface
);
static
const
WCHAR
enusW
[]
=
{
'e'
,
'n'
,
'-'
,
'u'
,
's'
,
0
};
HRESULT
hr
;
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
names
);
return
create_localizedstrings
(
names
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
names
);
hr
=
create_localizedstrings
(
names
);
if
(
FAILED
(
hr
))
return
hr
;
return
add_localizedstring
(
*
names
,
enusW
,
This
->
familyname
);
}
static
HRESULT
WINAPI
dwritefontfamily_GetFirstMatchingFont
(
IDWriteFontFamily
*
iface
,
DWRITE_FONT_WEIGHT
weight
,
...
...
dlls/dwrite/main.c
View file @
98ce55c1
...
...
@@ -172,9 +172,18 @@ static HRESULT create_renderingparams(FLOAT gamma, FLOAT enhancedContrast, FLOAT
return
S_OK
;
}
struct
localizedpair
{
WCHAR
*
locale
;
WCHAR
*
string
;
};
struct
localizedstrings
{
IDWriteLocalizedStrings
IDWriteLocalizedStrings_iface
;
LONG
ref
;
struct
localizedpair
*
data
;
UINT32
count
;
UINT32
alloc
;
};
static
inline
struct
localizedstrings
*
impl_from_IDWriteLocalizedStrings
(
IDWriteLocalizedStrings
*
iface
)
...
...
@@ -215,8 +224,17 @@ static ULONG WINAPI localizedstrings_Release(IDWriteLocalizedStrings *iface)
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
if
(
!
ref
)
if
(
!
ref
)
{
int
i
;
for
(
i
=
0
;
i
<
This
->
count
;
i
++
)
{
heap_free
(
This
->
data
[
i
].
locale
);
heap_free
(
This
->
data
[
i
].
string
);
}
heap_free
(
This
->
data
);
heap_free
(
This
);
}
return
S_OK
;
}
...
...
@@ -224,8 +242,8 @@ static ULONG WINAPI localizedstrings_Release(IDWriteLocalizedStrings *iface)
static
UINT32
WINAPI
localizedstrings_GetCount
(
IDWriteLocalizedStrings
*
iface
)
{
struct
localizedstrings
*
This
=
impl_from_IDWriteLocalizedStrings
(
iface
);
FIXME
(
"(%p): stub
\n
"
,
This
);
return
0
;
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
count
;
}
static
HRESULT
WINAPI
localizedstrings_FindLocaleName
(
IDWriteLocalizedStrings
*
iface
,
...
...
@@ -287,12 +305,35 @@ HRESULT create_localizedstrings(IDWriteLocalizedStrings **strings)
This
->
IDWriteLocalizedStrings_iface
.
lpVtbl
=
&
localizedstringsvtbl
;
This
->
ref
=
1
;
This
->
count
=
0
;
This
->
data
=
heap_alloc_zero
(
sizeof
(
struct
localizedpair
));
if
(
!
This
->
data
)
{
heap_free
(
This
);
return
E_OUTOFMEMORY
;
}
This
->
alloc
=
1
;
*
strings
=
&
This
->
IDWriteLocalizedStrings_iface
;
return
S_OK
;
}
HRESULT
add_localizedstring
(
IDWriteLocalizedStrings
*
iface
,
const
WCHAR
*
locale
,
const
WCHAR
*
string
)
{
struct
localizedstrings
*
This
=
impl_from_IDWriteLocalizedStrings
(
iface
);
if
(
This
->
count
==
This
->
alloc
)
{
This
->
alloc
*=
2
;
This
->
data
=
heap_realloc
(
This
->
data
,
This
->
alloc
*
sizeof
(
struct
localizedpair
));
}
This
->
data
[
This
->
count
].
locale
=
heap_strdupW
(
locale
);
This
->
data
[
This
->
count
].
string
=
heap_strdupW
(
string
);
This
->
count
++
;
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefactory_QueryInterface
(
IDWriteFactory
*
iface
,
REFIID
riid
,
void
**
obj
)
{
TRACE
(
"(%s %p)
\n
"
,
debugstr_guid
(
riid
),
obj
);
...
...
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