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
7babf757
Commit
7babf757
authored
Jul 08, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Move default IMM window proc implementation from user32.
parent
f6ddd4ca
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
126 additions
and
114 deletions
+126
-114
imm.c
dlls/imm32/imm.c
+112
-5
imm32.spec
dlls/imm32/imm32.spec
+1
-1
misc.c
dlls/user32/misc.c
+8
-104
ntuser_private.h
dlls/win32u/ntuser_private.h
+0
-4
ntuser.h
include/ntuser.h
+5
-0
No files found.
dlls/imm32/imm.c
View file @
7babf757
...
...
@@ -43,6 +43,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(imm);
#define IMM_INIT_MAGIC 0x19650412
BOOL
WINAPI
User32InitializeImmEntryTable
(
DWORD
);
/* MSIME messages */
static
UINT
WM_MSIME_SERVICE
;
static
UINT
WM_MSIME_RECONVERTOPTIONS
;
static
UINT
WM_MSIME_MOUSE
;
static
UINT
WM_MSIME_RECONVERTREQUEST
;
static
UINT
WM_MSIME_RECONVERT
;
static
UINT
WM_MSIME_QUERYPOSITION
;
static
UINT
WM_MSIME_DOCUMENTFEED
;
typedef
struct
_tagImmHkl
{
struct
list
entry
;
HKL
hkl
;
...
...
@@ -534,11 +543,6 @@ static ImmHkl *IMM_GetImmHkl(HKL hkl)
}
#undef LOAD_FUNCPTR
HWND
WINAPI
__wine_get_ui_window
(
HKL
hkl
)
{
ImmHkl
*
immHkl
=
IMM_GetImmHkl
(
hkl
);
return
immHkl
->
UIWnd
;
}
static
void
IMM_FreeAllImmHkl
(
void
)
{
...
...
@@ -3361,3 +3365,106 @@ BOOL WINAPI ImmDisableLegacyIME(void)
FIXME
(
"stub
\n
"
);
return
TRUE
;
}
static
HWND
get_ui_window
(
HKL
hkl
)
{
ImmHkl
*
immHkl
=
IMM_GetImmHkl
(
hkl
);
return
immHkl
->
UIWnd
;
}
static
BOOL
is_ime_ui_msg
(
UINT
msg
)
{
switch
(
msg
)
{
case
WM_IME_STARTCOMPOSITION
:
case
WM_IME_ENDCOMPOSITION
:
case
WM_IME_COMPOSITION
:
case
WM_IME_SETCONTEXT
:
case
WM_IME_NOTIFY
:
case
WM_IME_CONTROL
:
case
WM_IME_COMPOSITIONFULL
:
case
WM_IME_SELECT
:
case
WM_IME_CHAR
:
case
WM_IME_REQUEST
:
case
WM_IME_KEYDOWN
:
case
WM_IME_KEYUP
:
return
TRUE
;
default:
return
msg
==
WM_MSIME_RECONVERTOPTIONS
||
msg
==
WM_MSIME_SERVICE
||
msg
==
WM_MSIME_MOUSE
||
msg
==
WM_MSIME_RECONVERTREQUEST
||
msg
==
WM_MSIME_RECONVERT
||
msg
==
WM_MSIME_QUERYPOSITION
||
msg
==
WM_MSIME_DOCUMENTFEED
;
}
}
static
LRESULT
ime_internal_msg
(
WPARAM
wparam
,
LPARAM
lparam
)
{
HWND
hwnd
=
(
HWND
)
lparam
;
HIMC
himc
;
switch
(
wparam
)
{
case
IME_INTERNAL_ACTIVATE
:
case
IME_INTERNAL_DEACTIVATE
:
himc
=
ImmGetContext
(
hwnd
);
ImmSetActiveContext
(
hwnd
,
himc
,
wparam
==
IME_INTERNAL_ACTIVATE
);
ImmReleaseContext
(
hwnd
,
himc
);
break
;
default:
FIXME
(
"wparam = %Ix
\n
"
,
wparam
);
break
;
}
return
0
;
}
static
void
init_messages
(
void
)
{
static
BOOL
initialized
;
if
(
initialized
)
return
;
WM_MSIME_SERVICE
=
RegisterWindowMessageW
(
L"MSIMEService"
);
WM_MSIME_RECONVERTOPTIONS
=
RegisterWindowMessageW
(
L"MSIMEReconvertOptions"
);
WM_MSIME_MOUSE
=
RegisterWindowMessageW
(
L"MSIMEMouseOperation"
);
WM_MSIME_RECONVERTREQUEST
=
RegisterWindowMessageW
(
L"MSIMEReconvertRequest"
);
WM_MSIME_RECONVERT
=
RegisterWindowMessageW
(
L"MSIMEReconvert"
);
WM_MSIME_QUERYPOSITION
=
RegisterWindowMessageW
(
L"MSIMEQueryPosition"
);
WM_MSIME_DOCUMENTFEED
=
RegisterWindowMessageW
(
L"MSIMEDocumentFeed"
);
initialized
=
TRUE
;
}
LRESULT
WINAPI
__wine_ime_wnd_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
,
BOOL
ansi
)
{
HWND
uiwnd
;
switch
(
msg
)
{
case
WM_CREATE
:
init_messages
();
return
TRUE
;
case
WM_IME_INTERNAL
:
return
ime_internal_msg
(
wparam
,
lparam
);
}
if
(
is_ime_ui_msg
(
msg
))
{
if
((
uiwnd
=
get_ui_window
(
NtUserGetKeyboardLayout
(
0
))))
{
if
(
ansi
)
return
SendMessageA
(
uiwnd
,
msg
,
wparam
,
lparam
);
else
return
SendMessageW
(
uiwnd
,
msg
,
wparam
,
lparam
);
}
return
FALSE
;
}
if
(
ansi
)
return
DefWindowProcA
(
hwnd
,
msg
,
wparam
,
lparam
);
else
return
DefWindowProcW
(
hwnd
,
msg
,
wparam
,
lparam
);
}
dlls/imm32/imm32.spec
View file @
7babf757
...
...
@@ -114,6 +114,6 @@
################################################################
# Wine internal extensions
@ stdcall __wine_
get_ui_window(ptr
)
@ stdcall __wine_
ime_wnd_proc(long long long long long
)
@ stdcall __wine_register_window(long)
@ stdcall __wine_unregister_window(long)
dlls/user32/misc.c
View file @
7babf757
...
...
@@ -38,19 +38,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(win);
BOOL
WINAPI
ImmSetActiveContext
(
HWND
,
HIMC
,
BOOL
);
#define IMM_INIT_MAGIC 0x19650412
static
HWND
(
WINAPI
*
imm_get_ui_window
)(
HKL
);
static
LRESULT
(
WINAPI
*
imm_ime_wnd_proc
)(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
,
BOOL
ansi
);
BOOL
(
WINAPI
*
imm_register_window
)(
HWND
)
=
NULL
;
void
(
WINAPI
*
imm_unregister_window
)(
HWND
)
=
NULL
;
/* MSIME messages */
static
UINT
WM_MSIME_SERVICE
;
static
UINT
WM_MSIME_RECONVERTOPTIONS
;
static
UINT
WM_MSIME_MOUSE
;
static
UINT
WM_MSIME_RECONVERTREQUEST
;
static
UINT
WM_MSIME_RECONVERT
;
static
UINT
WM_MSIME_QUERYPOSITION
;
static
UINT
WM_MSIME_DOCUMENTFEED
;
/* USER signal proc flags and codes */
/* See UserSignalProc for comments */
#define USIG_FLAGS_WIN32 0x0001
...
...
@@ -332,22 +323,14 @@ BOOL WINAPI User32InitializeImmEntryTable(DWORD magic)
if
(
!
imm32
||
magic
!=
IMM_INIT_MAGIC
)
return
FALSE
;
if
(
imm_
get_ui_window
)
if
(
imm_
ime_wnd_proc
)
return
TRUE
;
WM_MSIME_SERVICE
=
RegisterWindowMessageA
(
"MSIMEService"
);
WM_MSIME_RECONVERTOPTIONS
=
RegisterWindowMessageA
(
"MSIMEReconvertOptions"
);
WM_MSIME_MOUSE
=
RegisterWindowMessageA
(
"MSIMEMouseOperation"
);
WM_MSIME_RECONVERTREQUEST
=
RegisterWindowMessageA
(
"MSIMEReconvertRequest"
);
WM_MSIME_RECONVERT
=
RegisterWindowMessageA
(
"MSIMEReconvert"
);
WM_MSIME_QUERYPOSITION
=
RegisterWindowMessageA
(
"MSIMEQueryPosition"
);
WM_MSIME_DOCUMENTFEED
=
RegisterWindowMessageA
(
"MSIMEDocumentFeed"
);
/* this part is not compatible with native imm32.dll */
imm_
get_ui_window
=
(
void
*
)
GetProcAddress
(
imm32
,
"__wine_get_ui_window
"
);
imm_
ime_wnd_proc
=
(
void
*
)
GetProcAddress
(
imm32
,
"__wine_ime_wnd_proc
"
);
imm_register_window
=
(
void
*
)
GetProcAddress
(
imm32
,
"__wine_register_window"
);
imm_unregister_window
=
(
void
*
)
GetProcAddress
(
imm32
,
"__wine_unregister_window"
);
if
(
!
imm_
get_ui_window
)
if
(
!
imm_
ime_wnd_proc
)
FIXME
(
"native imm32.dll not supported
\n
"
);
return
TRUE
;
}
...
...
@@ -561,93 +544,14 @@ const struct builtin_class_descr IME_builtin_class =
0
/* brush */
};
static
BOOL
is_ime_ui_msg
(
UINT
msg
)
{
switch
(
msg
)
{
case
WM_IME_STARTCOMPOSITION
:
case
WM_IME_ENDCOMPOSITION
:
case
WM_IME_COMPOSITION
:
case
WM_IME_SETCONTEXT
:
case
WM_IME_NOTIFY
:
case
WM_IME_CONTROL
:
case
WM_IME_COMPOSITIONFULL
:
case
WM_IME_SELECT
:
case
WM_IME_CHAR
:
case
WM_IME_REQUEST
:
case
WM_IME_KEYDOWN
:
case
WM_IME_KEYUP
:
return
TRUE
;
default:
if
((
msg
==
WM_MSIME_RECONVERTOPTIONS
)
||
(
msg
==
WM_MSIME_SERVICE
)
||
(
msg
==
WM_MSIME_MOUSE
)
||
(
msg
==
WM_MSIME_RECONVERTREQUEST
)
||
(
msg
==
WM_MSIME_RECONVERT
)
||
(
msg
==
WM_MSIME_QUERYPOSITION
)
||
(
msg
==
WM_MSIME_DOCUMENTFEED
))
return
TRUE
;
return
FALSE
;
}
}
static
LRESULT
ime_internal_msg
(
WPARAM
wParam
,
LPARAM
lParam
)
{
HWND
hwnd
=
(
HWND
)
lParam
;
HIMC
himc
;
switch
(
wParam
)
{
case
IME_INTERNAL_ACTIVATE
:
case
IME_INTERNAL_DEACTIVATE
:
himc
=
ImmGetContext
(
hwnd
);
ImmSetActiveContext
(
hwnd
,
himc
,
wParam
==
IME_INTERNAL_ACTIVATE
);
ImmReleaseContext
(
hwnd
,
himc
);
break
;
default:
FIXME
(
"wParam = %Ix
\n
"
,
wParam
);
break
;
}
return
0
;
}
LRESULT
WINAPI
ImeWndProcA
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
HWND
uiwnd
;
if
(
msg
==
WM_CREATE
)
return
TRUE
;
if
(
msg
==
WM_IME_INTERNAL
)
return
ime_internal_msg
(
wParam
,
lParam
);
if
(
imm_get_ui_window
&&
is_ime_ui_msg
(
msg
))
{
if
((
uiwnd
=
imm_get_ui_window
(
NtUserGetKeyboardLayout
(
0
)
)))
return
SendMessageA
(
uiwnd
,
msg
,
wParam
,
lParam
);
return
FALSE
;
}
return
DefWindowProcA
(
hwnd
,
msg
,
wParam
,
lParam
);
if
(
!
imm_ime_wnd_proc
)
return
DefWindowProcA
(
hwnd
,
msg
,
wParam
,
lParam
);
return
imm_ime_wnd_proc
(
hwnd
,
msg
,
wParam
,
lParam
,
TRUE
);
}
LRESULT
WINAPI
ImeWndProcW
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
HWND
uiwnd
;
if
(
msg
==
WM_CREATE
)
return
TRUE
;
if
(
msg
==
WM_IME_INTERNAL
)
return
ime_internal_msg
(
wParam
,
lParam
);
if
(
imm_get_ui_window
&&
is_ime_ui_msg
(
msg
))
{
if
((
uiwnd
=
imm_get_ui_window
(
NtUserGetKeyboardLayout
(
0
)
)))
return
SendMessageW
(
uiwnd
,
msg
,
wParam
,
lParam
);
return
FALSE
;
}
return
DefWindowProcW
(
hwnd
,
msg
,
wParam
,
lParam
);
if
(
!
imm_ime_wnd_proc
)
return
DefWindowProcW
(
hwnd
,
msg
,
wParam
,
lParam
);
return
imm_ime_wnd_proc
(
hwnd
,
msg
,
wParam
,
lParam
,
FALSE
);
}
dlls/win32u/ntuser_private.h
View file @
7babf757
...
...
@@ -134,10 +134,6 @@ static inline BOOL is_broadcast( HWND hwnd )
return
hwnd
==
HWND_BROADCAST
||
hwnd
==
HWND_TOPMOST
;
}
#define WM_IME_INTERNAL 0x287
#define IME_INTERNAL_ACTIVATE 0x17
#define IME_INTERNAL_DEACTIVATE 0x18
/* this is the structure stored in TEB->Win32ClientInfo */
/* no attempt is made to keep the layout compatible with the Windows one */
struct
user_thread_info
...
...
include/ntuser.h
View file @
7babf757
...
...
@@ -385,6 +385,11 @@ enum wine_internal_message
WM_WINE_LAST_DRIVER_MSG
=
0x80001fff
};
/* internal IME message */
#define WM_IME_INTERNAL 0x287
#define IME_INTERNAL_ACTIVATE 0x17
#define IME_INTERNAL_DEACTIVATE 0x18
/* the various structures that can be sent in messages, in platform-independent layout */
struct
packed_CREATESTRUCTW
{
...
...
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