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
e2eb760f
Commit
e2eb760f
authored
Nov 05, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 05, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Implement remaining methods of IDWriteLocalizedStrings.
parent
ad69c7bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
10 deletions
+56
-10
main.c
dlls/dwrite/main.c
+42
-7
font.c
dlls/dwrite/tests/font.c
+14
-3
No files found.
dlls/dwrite/main.c
View file @
e2eb760f
...
...
@@ -256,22 +256,57 @@ static HRESULT WINAPI localizedstrings_FindLocaleName(IDWriteLocalizedStrings *i
WCHAR
const
*
locale_name
,
UINT32
*
index
,
BOOL
*
exists
)
{
struct
localizedstrings
*
This
=
impl_from_IDWriteLocalizedStrings
(
iface
);
FIXME
(
"(%p)->(%s %p %p): stub
\n
"
,
This
,
debugstr_w
(
locale_name
),
index
,
exists
);
return
E_NOTIMPL
;
UINT32
i
;
TRACE
(
"(%p)->(%s %p %p)
\n
"
,
This
,
debugstr_w
(
locale_name
),
index
,
exists
);
*
exists
=
FALSE
;
*
index
=
~
0
;
for
(
i
=
0
;
i
<
This
->
count
;
i
++
)
{
if
(
!
strcmpiW
(
This
->
data
[
i
].
locale
,
locale_name
))
{
*
exists
=
TRUE
;
*
index
=
i
;
break
;
}
}
return
S_OK
;
}
static
HRESULT
WINAPI
localizedstrings_GetLocaleNameLength
(
IDWriteLocalizedStrings
*
iface
,
UINT32
index
,
UINT32
*
length
)
{
struct
localizedstrings
*
This
=
impl_from_IDWriteLocalizedStrings
(
iface
);
FIXME
(
"(%p)->(%u %p): stub
\n
"
,
This
,
index
,
length
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%u %p)
\n
"
,
This
,
index
,
length
);
if
(
index
>=
This
->
count
)
{
*
length
=
(
UINT32
)
-
1
;
return
E_FAIL
;
}
*
length
=
strlenW
(
This
->
data
[
index
].
locale
);
return
S_OK
;
}
static
HRESULT
WINAPI
localizedstrings_GetLocaleName
(
IDWriteLocalizedStrings
*
iface
,
UINT32
index
,
WCHAR
*
locale_name
,
UINT32
size
)
static
HRESULT
WINAPI
localizedstrings_GetLocaleName
(
IDWriteLocalizedStrings
*
iface
,
UINT32
index
,
WCHAR
*
buffer
,
UINT32
size
)
{
struct
localizedstrings
*
This
=
impl_from_IDWriteLocalizedStrings
(
iface
);
FIXME
(
"(%p)->(%u %p %u): stub
\n
"
,
This
,
index
,
locale_name
,
size
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%u %p %u)
\n
"
,
This
,
index
,
buffer
,
size
);
if
(
index
>=
This
->
count
)
{
if
(
buffer
)
*
buffer
=
0
;
return
E_FAIL
;
}
if
(
size
<
strlenW
(
This
->
data
[
index
].
locale
)
+
1
)
{
if
(
buffer
)
*
buffer
=
0
;
return
E_NOT_SUFFICIENT_BUFFER
;
}
strcpyW
(
buffer
,
This
->
data
[
index
].
locale
);
return
S_OK
;
}
static
HRESULT
WINAPI
localizedstrings_GetStringLength
(
IDWriteLocalizedStrings
*
iface
,
UINT32
index
,
UINT32
*
length
)
...
...
dlls/dwrite/tests/font.c
View file @
e2eb760f
...
...
@@ -2051,14 +2051,16 @@ todo_wine
static
void
test_GetFaceNames
(
void
)
{
static
const
WCHAR
obliqueW
[]
=
{
'O'
,
'b'
,
'l'
,
'i'
,
'q'
,
'u'
,
'e'
,
0
};
static
const
WCHAR
enus2W
[]
=
{
'e'
,
'n'
,
'-'
,
'U'
,
's'
,
0
};
static
const
WCHAR
enusW
[]
=
{
'e'
,
'n'
,
'-'
,
'u'
,
's'
,
0
};
IDWriteLocalizedStrings
*
strings
,
*
strings2
;
IDWriteGdiInterop
*
interop
;
IDWriteFactory
*
factory
;
UINT32
count
,
index
;
IDWriteFont
*
font
;
LOGFONTW
logfont
;
WCHAR
buffW
[
255
];
UINT32
count
;
BOOL
exists
;
HRESULT
hr
;
factory
=
create_factory
();
...
...
@@ -2087,13 +2089,22 @@ static void test_GetFaceNames(void)
count
=
IDWriteLocalizedStrings_GetCount
(
strings
);
ok
(
count
==
1
,
"got %d
\n
"
,
count
);
index
=
1
;
exists
=
FALSE
;
hr
=
IDWriteLocalizedStrings_FindLocaleName
(
strings
,
enus2W
,
&
index
,
&
exists
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
index
==
0
&&
exists
,
"got %d, %d
\n
"
,
index
,
exists
);
count
=
0
;
hr
=
IDWriteLocalizedStrings_GetLocaleNameLength
(
strings
,
1
,
&
count
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
count
==
~
0
,
"got %d
\n
"
,
count
);
/* for simulated faces names are also simulated */
buffW
[
0
]
=
0
;
hr
=
IDWriteLocalizedStrings_GetLocaleName
(
strings
,
0
,
buffW
,
sizeof
(
buffW
)
/
sizeof
(
WCHAR
));
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
buffW
,
enusW
),
"got %s
\n
"
,
wine_dbgstr_w
(
buffW
));
}
buffW
[
0
]
=
0
;
hr
=
IDWriteLocalizedStrings_GetString
(
strings
,
0
,
buffW
,
sizeof
(
buffW
)
/
sizeof
(
WCHAR
));
...
...
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