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
4e7aa4fb
Commit
4e7aa4fb
authored
Feb 21, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Rename input context immKbd to ime.
parent
0b34236d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
44 deletions
+39
-44
imm.c
dlls/imm32/imm.c
+39
-44
No files found.
dlls/imm32/imm.c
View file @
4e7aa4fb
...
...
@@ -91,7 +91,7 @@ typedef struct tagInputContextData
INPUTCONTEXT
IMC
;
DWORD
threadID
;
struct
ime
*
im
mKbd
;
struct
ime
*
im
e
;
UINT
lastVK
;
BOOL
threadDefault
;
}
InputContextData
;
...
...
@@ -118,7 +118,7 @@ static const WCHAR szImeRegFmt[] = L"System\\CurrentControlSet\\Control\\Keyboar
static
inline
BOOL
is_himc_ime_unicode
(
const
InputContextData
*
data
)
{
return
!!
(
data
->
im
mKbd
->
imeInfo
.
fdwProperty
&
IME_PROP_UNICODE
);
return
!!
(
data
->
im
e
->
imeInfo
.
fdwProperty
&
IME_PROP_UNICODE
);
}
static
inline
BOOL
is_kbd_ime_unicode
(
const
struct
ime
*
hkl
)
...
...
@@ -531,9 +531,9 @@ static BOOL free_input_context_data( HIMC hIMC )
TRACE
(
"Destroying %p
\n
"
,
hIMC
);
data
->
im
mKbd
->
uSelected
--
;
data
->
im
mKbd
->
pImeSelect
(
hIMC
,
FALSE
);
SendMessageW
(
data
->
IMC
.
hWnd
,
WM_IME_SELECT
,
FALSE
,
(
LPARAM
)
data
->
im
mKbd
);
data
->
im
e
->
uSelected
--
;
data
->
im
e
->
pImeSelect
(
hIMC
,
FALSE
);
SendMessageW
(
data
->
IMC
.
hWnd
,
WM_IME_SELECT
,
FALSE
,
(
LPARAM
)
data
->
im
e
);
ImmDestroyIMCC
(
data
->
IMC
.
hCompStr
);
ImmDestroyIMCC
(
data
->
IMC
.
hCandInfo
);
...
...
@@ -672,7 +672,7 @@ BOOL WINAPI ImmSetActiveContext(HWND hwnd, HIMC himc, BOOL activate)
if
(
data
)
{
data
->
IMC
.
hWnd
=
activate
?
hwnd
:
NULL
;
data
->
im
mKbd
->
pImeSetActiveContext
(
himc
,
activate
);
data
->
im
e
->
pImeSetActiveContext
(
himc
,
activate
);
}
if
(
IsWindow
(
hwnd
))
...
...
@@ -813,7 +813,7 @@ static InputContextData *create_input_context(HIMC default_imc)
/* Load the IME */
new_context
->
threadDefault
=
!!
default_imc
;
if
(
!
(
new_context
->
im
mKbd
=
IMM_GetImmHkl
(
GetKeyboardLayout
(
0
)
)))
if
(
!
(
new_context
->
im
e
=
IMM_GetImmHkl
(
GetKeyboardLayout
(
0
)
)))
{
TRACE
(
"IME dll could not be loaded
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
new_context
);
...
...
@@ -838,10 +838,10 @@ static InputContextData *create_input_context(HIMC default_imc)
new_context
->
IMC
.
cfCandForm
[
i
].
dwIndex
=
~
0u
;
/* Initialize the IME Private */
new_context
->
IMC
.
hPrivate
=
ImmCreateIMCC
(
new_context
->
immKbd
->
imeInfo
.
dwPrivateDataSize
);
new_context
->
IMC
.
hPrivate
=
ImmCreateIMCC
(
new_context
->
ime
->
imeInfo
.
dwPrivateDataSize
);
new_context
->
IMC
.
fdwConversion
=
new_context
->
im
mKbd
->
imeInfo
.
fdwConversionCaps
;
new_context
->
IMC
.
fdwSentence
=
new_context
->
im
mKbd
->
imeInfo
.
fdwSentenceCaps
;
new_context
->
IMC
.
fdwConversion
=
new_context
->
im
e
->
imeInfo
.
fdwConversionCaps
;
new_context
->
IMC
.
fdwSentence
=
new_context
->
im
e
->
imeInfo
.
fdwSentenceCaps
;
if
(
!
default_imc
)
new_context
->
handle
=
NtUserCreateInputContext
((
UINT_PTR
)
new_context
);
...
...
@@ -853,16 +853,16 @@ static InputContextData *create_input_context(HIMC default_imc)
return
0
;
}
if
(
!
new_context
->
im
mKbd
->
pImeSelect
(
new_context
->
handle
,
TRUE
))
if
(
!
new_context
->
im
e
->
pImeSelect
(
new_context
->
handle
,
TRUE
))
{
TRACE
(
"Selection of IME failed
\n
"
);
IMM_DestroyContext
(
new_context
);
return
0
;
}
new_context
->
threadID
=
GetCurrentThreadId
();
SendMessageW
(
GetFocus
(),
WM_IME_SELECT
,
TRUE
,
(
LPARAM
)
new_context
->
immKbd
);
SendMessageW
(
GetFocus
(),
WM_IME_SELECT
,
TRUE
,
(
LPARAM
)
new_context
->
ime
);
new_context
->
im
mKbd
->
uSelected
++
;
new_context
->
im
e
->
uSelected
++
;
TRACE
(
"Created context %p
\n
"
,
new_context
);
return
new_context
;
}
...
...
@@ -2117,7 +2117,7 @@ BOOL WINAPI ImmNotifyIME(
return
FALSE
;
}
return
data
->
im
mKbd
->
pNotifyIME
(
hIMC
,
dwAction
,
dwIndex
,
dwValue
);
return
data
->
im
e
->
pNotifyIME
(
hIMC
,
dwAction
,
dwIndex
,
dwValue
);
}
/***********************************************************************
...
...
@@ -2326,9 +2326,8 @@ BOOL WINAPI ImmSetCompositionStringA(
dwIndex
==
SCS_QUERYRECONVERTSTRING
))
return
FALSE
;
if
(
!
is_himc_ime_unicode
(
data
))
return
data
->
immKbd
->
pImeSetCompositionString
(
hIMC
,
dwIndex
,
lpComp
,
dwCompLen
,
lpRead
,
dwReadLen
);
if
(
!
is_himc_ime_unicode
(
data
))
return
data
->
ime
->
pImeSetCompositionString
(
hIMC
,
dwIndex
,
lpComp
,
dwCompLen
,
lpRead
,
dwReadLen
);
comp_len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpComp
,
dwCompLen
,
NULL
,
0
);
if
(
comp_len
)
...
...
@@ -2384,9 +2383,8 @@ BOOL WINAPI ImmSetCompositionStringW(
dwIndex
==
SCS_QUERYRECONVERTSTRING
))
return
FALSE
;
if
(
is_himc_ime_unicode
(
data
))
return
data
->
immKbd
->
pImeSetCompositionString
(
hIMC
,
dwIndex
,
lpComp
,
dwCompLen
,
lpRead
,
dwReadLen
);
if
(
is_himc_ime_unicode
(
data
))
return
data
->
ime
->
pImeSetCompositionString
(
hIMC
,
dwIndex
,
lpComp
,
dwCompLen
,
lpRead
,
dwReadLen
);
comp_len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
lpComp
,
dwCompLen
,
NULL
,
0
,
NULL
,
NULL
);
...
...
@@ -2441,16 +2439,15 @@ BOOL WINAPI ImmSetCompositionWindow(
data
->
IMC
.
cfCompForm
=
*
lpCompForm
;
if
(
IsWindowVisible
(
data
->
immKbd
->
UIWnd
))
if
(
IsWindowVisible
(
data
->
ime
->
UIWnd
))
{
reshow
=
TRUE
;
ShowWindow
(
data
->
immKbd
->
UIWnd
,
SW_HIDE
);
ShowWindow
(
data
->
ime
->
UIWnd
,
SW_HIDE
);
}
/* FIXME: this is a partial stub */
if
(
reshow
)
ShowWindow
(
data
->
immKbd
->
UIWnd
,
SW_SHOWNOACTIVATE
);
if
(
reshow
)
ShowWindow
(
data
->
ime
->
UIWnd
,
SW_SHOWNOACTIVATE
);
ImmInternalSendIMENotify
(
data
,
IMN_SETCOMPOSITIONWINDOW
,
0
);
return
TRUE
;
...
...
@@ -2512,16 +2509,14 @@ BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
if
(
IMM_IsCrossThreadAccess
(
NULL
,
hIMC
))
return
FALSE
;
if
(
data
->
im
mKbd
->
UIWnd
==
NULL
)
if
(
data
->
im
e
->
UIWnd
==
NULL
)
{
/* create the ime window */
data
->
immKbd
->
UIWnd
=
CreateWindowExW
(
WS_EX_TOOLWINDOW
,
data
->
immKbd
->
imeClassName
,
NULL
,
WS_POPUP
,
0
,
0
,
1
,
1
,
0
,
0
,
data
->
immKbd
->
hIME
,
0
);
SetWindowLongPtrW
(
data
->
immKbd
->
UIWnd
,
IMMGWL_IMC
,
(
LONG_PTR
)
data
);
data
->
ime
->
UIWnd
=
CreateWindowExW
(
WS_EX_TOOLWINDOW
,
data
->
ime
->
imeClassName
,
NULL
,
WS_POPUP
,
0
,
0
,
1
,
1
,
0
,
0
,
data
->
ime
->
hIME
,
0
);
SetWindowLongPtrW
(
data
->
ime
->
UIWnd
,
IMMGWL_IMC
,
(
LONG_PTR
)
data
);
}
else
if
(
fOpen
)
SetWindowLongPtrW
(
data
->
immKbd
->
UIWnd
,
IMMGWL_IMC
,
(
LONG_PTR
)
data
);
else
if
(
fOpen
)
SetWindowLongPtrW
(
data
->
ime
->
UIWnd
,
IMMGWL_IMC
,
(
LONG_PTR
)
data
);
if
(
!
fOpen
!=
!
data
->
IMC
.
fOpen
)
{
...
...
@@ -2669,7 +2664,7 @@ DWORD WINAPI ImmGetImeMenuItemsA( HIMC himc, DWORD flags, DWORD type, IMEMENUITE
}
if
(
!
is_himc_ime_unicode
(
data
)
||
(
!
parentA
&&
!
menuA
))
ret
=
data
->
im
mKbd
->
pImeGetImeMenuItems
(
himc
,
flags
,
type
,
parentA
,
menuA
,
size
);
ret
=
data
->
im
e
->
pImeGetImeMenuItems
(
himc
,
flags
,
type
,
parentA
,
menuA
,
size
);
else
{
IMEMENUITEMINFOW
tmpW
,
*
menuW
,
*
parentW
=
parentA
?
&
tmpW
:
NULL
;
...
...
@@ -2682,7 +2677,7 @@ DWORD WINAPI ImmGetImeMenuItemsA( HIMC himc, DWORD flags, DWORD type, IMEMENUITE
menuW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
}
ret
=
data
->
im
mKbd
->
pImeGetImeMenuItems
(
himc
,
flags
,
type
,
parentW
,
menuW
,
size
);
ret
=
data
->
im
e
->
pImeGetImeMenuItems
(
himc
,
flags
,
type
,
parentW
,
menuW
,
size
);
if
(
parentA
)
{
...
...
@@ -2727,7 +2722,7 @@ DWORD WINAPI ImmGetImeMenuItemsW( HIMC himc, DWORD flags, DWORD type, IMEMENUITE
}
if
(
is_himc_ime_unicode
(
data
)
||
(
!
parentW
&&
!
menuW
))
ret
=
data
->
im
mKbd
->
pImeGetImeMenuItems
(
himc
,
flags
,
type
,
parentW
,
menuW
,
size
);
ret
=
data
->
im
e
->
pImeGetImeMenuItems
(
himc
,
flags
,
type
,
parentW
,
menuW
,
size
);
else
{
IMEMENUITEMINFOA
tmpA
,
*
menuA
,
*
parentA
=
parentW
?
&
tmpA
:
NULL
;
...
...
@@ -2740,7 +2735,7 @@ DWORD WINAPI ImmGetImeMenuItemsW( HIMC himc, DWORD flags, DWORD type, IMEMENUITE
menuA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
}
ret
=
data
->
im
mKbd
->
pImeGetImeMenuItems
(
himc
,
flags
,
type
,
parentA
,
menuA
,
size
);
ret
=
data
->
im
e
->
pImeGetImeMenuItems
(
himc
,
flags
,
type
,
parentA
,
menuA
,
size
);
if
(
parentW
)
{
...
...
@@ -2923,7 +2918,7 @@ BOOL WINAPI ImmTranslateMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyD
list
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
list_count
*
sizeof
(
TRANSMSG
)
+
sizeof
(
DWORD
));
list
->
uMsgCount
=
list_count
;
if
(
data
->
im
mKbd
->
imeInfo
.
fdwProperty
&
IME_PROP_KBD_CHAR_FIRST
)
if
(
data
->
im
e
->
imeInfo
.
fdwProperty
&
IME_PROP_KBD_CHAR_FIRST
)
{
WCHAR
chr
;
...
...
@@ -2936,7 +2931,7 @@ BOOL WINAPI ImmTranslateMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyD
else
uVirtKey
=
data
->
lastVK
;
msg_count
=
data
->
im
mKbd
->
pImeToAsciiEx
(
uVirtKey
,
scancode
,
state
,
list
,
0
,
imc
);
msg_count
=
data
->
im
e
->
pImeToAsciiEx
(
uVirtKey
,
scancode
,
state
,
list
,
0
,
imc
);
TRACE
(
"%i messages generated
\n
"
,
msg_count
);
if
(
msg_count
&&
msg_count
<=
list_count
)
{
...
...
@@ -2971,21 +2966,21 @@ BOOL WINAPI ImmProcessKey(HWND hwnd, HKL hKL, UINT vKey, LPARAM lKeyData, DWORD
if
(
!
(
data
=
get_imc_data
(
imc
)))
return
FALSE
;
/* Make sure we are inputting to the correct keyboard */
if
(
data
->
im
mKbd
->
hkl
!=
hKL
)
if
(
data
->
im
e
->
hkl
!=
hKL
)
{
struct
ime
*
new_hkl
;
if
(
!
(
new_hkl
=
IMM_GetImmHkl
(
hKL
)))
return
FALSE
;
data
->
im
mKbd
->
pImeSelect
(
imc
,
FALSE
);
data
->
im
mKbd
->
uSelected
--
;
data
->
im
mKbd
=
new_hkl
;
data
->
im
mKbd
->
pImeSelect
(
imc
,
TRUE
);
data
->
im
mKbd
->
uSelected
++
;
data
->
im
e
->
pImeSelect
(
imc
,
FALSE
);
data
->
im
e
->
uSelected
--
;
data
->
im
e
=
new_hkl
;
data
->
im
e
->
pImeSelect
(
imc
,
TRUE
);
data
->
im
e
->
uSelected
++
;
}
GetKeyboardState
(
state
);
if
(
data
->
im
mKbd
->
pImeProcessKey
(
imc
,
vKey
,
lKeyData
,
state
))
if
(
data
->
im
e
->
pImeProcessKey
(
imc
,
vKey
,
lKeyData
,
state
))
{
data
->
lastVK
=
vKey
;
return
TRUE
;
...
...
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