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
fbecb0c3
Commit
fbecb0c3
authored
Sep 28, 2005
by
Aric Stewart
Committed by
Alexandre Julliard
Sep 28, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement a basic beginning for fnIMLangFontLink_CodePageToCodePages,
fnIMLangFontLink_CodePagesToCodePage and fnIMLangFontLink_GetFontCodePages. Also some tests for the new functions.
parent
c43e416b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
120 additions
and
6 deletions
+120
-6
mlang.c
dlls/mlang/mlang.c
+75
-6
mlang.c
dlls/mlang/tests/mlang.c
+45
-0
No files found.
dlls/mlang/mlang.c
View file @
fbecb0c3
...
...
@@ -1254,8 +1254,24 @@ static HRESULT WINAPI fnIMLangFontLink_CodePageToCodePages(
UINT
uCodePage
,
DWORD
*
pdwCodePages
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
ICOM_THIS_MULTI
(
MLang_impl
,
vtbl_IMLangFontLink
,
iface
);
CHARSETINFO
cs
;
BOOL
rc
;
TRACE
(
"(%p) Seeking %u
\n
"
,
This
,
uCodePage
);
memset
(
&
cs
,
0
,
sizeof
(
cs
));
rc
=
TranslateCharsetInfo
((
DWORD
*
)
uCodePage
,
&
cs
,
TCI_SRCCODEPAGE
);
if
(
rc
)
{
*
pdwCodePages
=
cs
.
fs
.
fsCsb
[
0
];
TRACE
(
"resulting CodePages 0x%lx
\n
"
,
*
pdwCodePages
);
}
else
TRACE
(
"CodePage Not Found
\n
"
);
return
S_OK
;
}
static
HRESULT
WINAPI
fnIMLangFontLink_CodePagesToCodePage
(
...
...
@@ -1264,8 +1280,49 @@ static HRESULT WINAPI fnIMLangFontLink_CodePagesToCodePage(
UINT
uDefaultCodePage
,
UINT
*
puCodePage
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
ICOM_THIS_MULTI
(
MLang_impl
,
vtbl_IMLangFontLink
,
iface
);
DWORD
mask
=
0x00000000
;
UINT
i
;
CHARSETINFO
cs
;
BOOL
rc
;
TRACE
(
"(%p) scanning 0x%lx default page %u
\n
"
,
This
,
dwCodePages
,
uDefaultCodePage
);
*
puCodePage
=
0x00000000
;
rc
=
TranslateCharsetInfo
((
DWORD
*
)
uDefaultCodePage
,
&
cs
,
TCI_SRCCODEPAGE
);
if
(
rc
&&
(
dwCodePages
&
cs
.
fs
.
fsCsb
[
0
]))
{
TRACE
(
"Found Default Codepage
\n
"
);
*
puCodePage
=
uDefaultCodePage
;
return
S_OK
;
}
for
(
i
=
0
;
i
<
32
;
i
++
)
{
mask
=
1
<<
i
;
if
(
dwCodePages
&
mask
)
{
DWORD
Csb
[
2
];
Csb
[
0
]
=
mask
;
Csb
[
1
]
=
0x0
;
rc
=
TranslateCharsetInfo
((
DWORD
*
)
Csb
,
&
cs
,
TCI_SRCFONTSIG
);
if
(
!
rc
)
continue
;
TRACE
(
"Falling back to least significant found CodePage %u
\n
"
,
cs
.
ciACP
);
*
puCodePage
=
cs
.
ciACP
;
return
S_OK
;
}
}
TRACE
(
"no codepage found
\n
"
);
return
E_FAIL
;
}
static
HRESULT
WINAPI
fnIMLangFontLink_GetFontCodePages
(
...
...
@@ -1274,8 +1331,20 @@ static HRESULT WINAPI fnIMLangFontLink_GetFontCodePages(
HFONT
hFont
,
DWORD
*
pdwCodePages
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
HFONT
old_font
;
FONTSIGNATURE
fontsig
;
ICOM_THIS_MULTI
(
MLang_impl
,
vtbl_IMLangFontLink
,
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
old_font
=
SelectObject
(
hDC
,
hFont
);
GetTextCharsetInfo
(
hDC
,
&
fontsig
,
0
);
SelectObject
(
hDC
,
old_font
);
*
pdwCodePages
=
fontsig
.
fsCsb
[
0
];
TRACE
(
"CodePages is 0x%lx
\n
"
,
fontsig
.
fsCsb
[
0
]);
return
S_OK
;
}
static
HRESULT
WINAPI
fnIMLangFontLink_MapFont
(
...
...
dlls/mlang/tests/mlang.c
View file @
fbecb0c3
...
...
@@ -606,9 +606,45 @@ static void test_EnumScripts(IMultiLanguage2 *iML2, DWORD flags)
IEnumScript_Release
(
iEnumScript
);
}
void
IMLangFontLink_Test
(
IMLangFontLink
*
iMLFL
)
{
DWORD
dwCodePages
=
0
;
DWORD
dwManyCodePages
=
0
;
UINT
CodePage
=
0
;
ok
(
IMLangFontLink_CodePageToCodePages
(
iMLFL
,
932
,
&
dwCodePages
)
==
S_OK
,
"IMLangFontLink_CodePageToCodePages failed
\n
"
);
ok
(
dwCodePages
!=
0
,
"No CodePages returned
\n
"
);
ok
(
IMLangFontLink_CodePagesToCodePage
(
iMLFL
,
dwCodePages
,
1035
,
&
CodePage
)
==
S_OK
,
"IMLangFontLink_CodePagesToCodePage failed
\n
"
);
ok
(
CodePage
==
932
,
"Incorrect CodePage Returned (%i)
\n
"
,
CodePage
);
ok
(
IMLangFontLink_CodePageToCodePages
(
iMLFL
,
1252
,
&
dwCodePages
)
==
S_OK
,
"IMLangFontLink_CodePageToCodePages failed
\n
"
);
dwManyCodePages
=
dwManyCodePages
|
dwCodePages
;
ok
(
IMLangFontLink_CodePageToCodePages
(
iMLFL
,
1256
,
&
dwCodePages
)
==
S_OK
,
"IMLangFontLink_CodePageToCodePages failed
\n
"
);
dwManyCodePages
=
dwManyCodePages
|
dwCodePages
;
ok
(
IMLangFontLink_CodePageToCodePages
(
iMLFL
,
874
,
&
dwCodePages
)
==
S_OK
,
"IMLangFontLink_CodePageToCodePages failed
\n
"
);
dwManyCodePages
=
dwManyCodePages
|
dwCodePages
;
ok
(
IMLangFontLink_CodePagesToCodePage
(
iMLFL
,
dwManyCodePages
,
1256
,
&
CodePage
)
==
S_OK
,
"IMLangFontLink_CodePagesToCodePage failed
\n
"
);
ok
(
CodePage
==
1256
,
"Incorrect CodePage Returned (%i)
\n
"
,
CodePage
);
ok
(
IMLangFontLink_CodePagesToCodePage
(
iMLFL
,
dwManyCodePages
,
936
,
&
CodePage
)
==
S_OK
,
"IMLangFontLink_CodePagesToCodePage failed
\n
"
);
ok
(
CodePage
==
1252
,
"Incorrect CodePage Returned (%i)
\n
"
,
CodePage
);
}
START_TEST
(
mlang
)
{
IMultiLanguage2
*
iML2
=
NULL
;
IMLangFontLink
*
iMLFL
=
NULL
;
HRESULT
ret
;
pGetCPInfoExA
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32.dll"
),
"GetCPInfoExA"
);
...
...
@@ -644,5 +680,14 @@ START_TEST(mlang)
IMultiLanguage2_Release
(
iML2
);
ret
=
CoCreateInstance
(
&
CLSID_CMultiLanguage
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMLangFontLink
,
(
void
**
)
&
iMLFL
);
trace
(
"ret = %08lx, IMLangFontLink iMLFL = %p
\n
"
,
ret
,
iMLFL
);
if
(
ret
!=
S_OK
||
!
iML2
)
return
;
IMLangFontLink_Test
(
iMLFL
);
IMLangFontLink_Release
(
iMLFL
);
CoUninitialize
();
}
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