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
f4fd36e5
Commit
f4fd36e5
authored
Apr 03, 2008
by
Aric Stewart
Committed by
Alexandre Julliard
Apr 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Implement ImmGetImeMenuItems using loaded IME.
parent
2a8a18fc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
105 additions
and
2 deletions
+105
-2
imm.c
dlls/imm32/imm.c
+105
-2
No files found.
dlls/imm32/imm.c
View file @
f4fd36e5
...
...
@@ -122,6 +122,7 @@ static void ImmInternalPostIMEMessage(InputContextData*, UINT, WPARAM, LPARAM);
static
void
ImmInternalSetOpenStatus
(
BOOL
fOpen
);
static
HIMCC
updateResultStr
(
HIMCC
old
,
LPWSTR
resultstr
,
DWORD
len
);
#define is_himc_ime_unicode(p) (p->immKbd->imeInfo.fdwProperty & IME_PROP_UNICODE)
#define is_kbd_ime_unicode(p) (p->imeInfo.fdwProperty & IME_PROP_UNICODE)
static
inline
WCHAR
*
strdupAtoW
(
const
char
*
str
)
...
...
@@ -2233,8 +2234,60 @@ DWORD WINAPI ImmGetImeMenuItemsA( HIMC hIMC, DWORD dwFlags, DWORD dwType,
LPIMEMENUITEMINFOA
lpImeParentMenu
,
LPIMEMENUITEMINFOA
lpImeMenu
,
DWORD
dwSize
)
{
FIXME
(
"(%p, %i, %i, %p, %p, %i): stub
\n
"
,
hIMC
,
dwFlags
,
dwType
,
InputContextData
*
data
=
(
InputContextData
*
)
hIMC
;
TRACE
(
"(%p, %i, %i, %p, %p, %i):
\n
"
,
hIMC
,
dwFlags
,
dwType
,
lpImeParentMenu
,
lpImeMenu
,
dwSize
);
if
(
data
->
immKbd
->
hIME
&&
data
->
immKbd
->
pImeGetImeMenuItems
)
{
if
(
!
is_himc_ime_unicode
(
data
)
||
(
!
lpImeParentMenu
&&
!
lpImeMenu
))
return
data
->
immKbd
->
pImeGetImeMenuItems
(
hIMC
,
dwFlags
,
dwType
,
(
IMEMENUITEMINFOW
*
)
lpImeParentMenu
,
(
IMEMENUITEMINFOW
*
)
lpImeMenu
,
dwSize
);
else
{
IMEMENUITEMINFOW
lpImeParentMenuW
;
IMEMENUITEMINFOW
*
lpImeMenuW
,
*
parent
=
NULL
;
DWORD
rc
;
if
(
lpImeParentMenu
)
parent
=
&
lpImeParentMenuW
;
if
(
lpImeMenu
)
{
int
count
=
dwSize
/
sizeof
(
LPIMEMENUITEMINFOA
);
dwSize
=
count
*
sizeof
(
IMEMENUITEMINFOW
);
lpImeMenuW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwSize
);
}
else
lpImeMenuW
=
NULL
;
rc
=
data
->
immKbd
->
pImeGetImeMenuItems
(
hIMC
,
dwFlags
,
dwType
,
parent
,
lpImeMenuW
,
dwSize
);
if
(
lpImeParentMenu
)
{
memcpy
(
lpImeParentMenu
,
&
lpImeParentMenuW
,
sizeof
(
IMEMENUITEMINFOA
));
lpImeParentMenu
->
hbmpItem
=
lpImeParentMenuW
.
hbmpItem
;
WideCharToMultiByte
(
CP_ACP
,
0
,
lpImeParentMenuW
.
szString
,
-
1
,
lpImeParentMenu
->
szString
,
IMEMENUITEM_STRING_SIZE
,
NULL
,
NULL
);
}
if
(
lpImeMenu
&&
rc
)
{
int
i
;
for
(
i
=
0
;
i
<
rc
;
i
++
)
{
memcpy
(
&
lpImeMenu
[
i
],
&
lpImeMenuW
[
1
],
sizeof
(
IMEMENUITEMINFOA
));
lpImeMenu
[
i
].
hbmpItem
=
lpImeMenuW
[
i
].
hbmpItem
;
WideCharToMultiByte
(
CP_ACP
,
0
,
lpImeMenuW
[
i
].
szString
,
-
1
,
lpImeMenu
[
i
].
szString
,
IMEMENUITEM_STRING_SIZE
,
NULL
,
NULL
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
lpImeMenuW
);
return
rc
;
}
}
else
return
0
;
}
...
...
@@ -2245,8 +2298,58 @@ DWORD WINAPI ImmGetImeMenuItemsW( HIMC hIMC, DWORD dwFlags, DWORD dwType,
LPIMEMENUITEMINFOW
lpImeParentMenu
,
LPIMEMENUITEMINFOW
lpImeMenu
,
DWORD
dwSize
)
{
FIXME
(
"(%p, %i, %i, %p, %p, %i): stub
\n
"
,
hIMC
,
dwFlags
,
dwType
,
InputContextData
*
data
=
(
InputContextData
*
)
hIMC
;
TRACE
(
"(%p, %i, %i, %p, %p, %i):
\n
"
,
hIMC
,
dwFlags
,
dwType
,
lpImeParentMenu
,
lpImeMenu
,
dwSize
);
if
(
data
->
immKbd
->
hIME
&&
data
->
immKbd
->
pImeGetImeMenuItems
)
{
if
(
is_himc_ime_unicode
(
data
)
||
(
!
lpImeParentMenu
&&
!
lpImeMenu
))
return
data
->
immKbd
->
pImeGetImeMenuItems
(
hIMC
,
dwFlags
,
dwType
,
lpImeParentMenu
,
lpImeMenu
,
dwSize
);
else
{
IMEMENUITEMINFOA
lpImeParentMenuA
;
IMEMENUITEMINFOA
*
lpImeMenuA
,
*
parent
=
NULL
;
DWORD
rc
;
if
(
lpImeParentMenu
)
parent
=
&
lpImeParentMenuA
;
if
(
lpImeMenu
)
{
int
count
=
dwSize
/
sizeof
(
LPIMEMENUITEMINFOW
);
dwSize
=
count
*
sizeof
(
IMEMENUITEMINFOA
);
lpImeMenuA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwSize
);
}
else
lpImeMenuA
=
NULL
;
rc
=
data
->
immKbd
->
pImeGetImeMenuItems
(
hIMC
,
dwFlags
,
dwType
,
(
IMEMENUITEMINFOW
*
)
parent
,
(
IMEMENUITEMINFOW
*
)
lpImeMenuA
,
dwSize
);
if
(
lpImeParentMenu
)
{
memcpy
(
lpImeParentMenu
,
&
lpImeParentMenuA
,
sizeof
(
IMEMENUITEMINFOA
));
lpImeParentMenu
->
hbmpItem
=
lpImeParentMenuA
.
hbmpItem
;
MultiByteToWideChar
(
CP_ACP
,
0
,
lpImeParentMenuA
.
szString
,
-
1
,
lpImeParentMenu
->
szString
,
IMEMENUITEM_STRING_SIZE
);
}
if
(
lpImeMenu
&&
rc
)
{
int
i
;
for
(
i
=
0
;
i
<
rc
;
i
++
)
{
memcpy
(
&
lpImeMenu
[
i
],
&
lpImeMenuA
[
1
],
sizeof
(
IMEMENUITEMINFOA
));
lpImeMenu
[
i
].
hbmpItem
=
lpImeMenuA
[
i
].
hbmpItem
;
MultiByteToWideChar
(
CP_ACP
,
0
,
lpImeMenuA
[
i
].
szString
,
-
1
,
lpImeMenu
[
i
].
szString
,
IMEMENUITEM_STRING_SIZE
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
lpImeMenuA
);
return
rc
;
}
}
else
return
0
;
}
...
...
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