From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winemac.drv/ime.c | 11 +++++++++-- dlls/winemac.drv/keyboard.c | 17 +++++++++++------ dlls/winemac.drv/macdrv.h | 3 +-- dlls/winemac.drv/macdrv_main.c | 8 ++++++++ dlls/winemac.drv/unixlib.h | 13 +++++++++++++ 5 files changed, 42 insertions(+), 10 deletions(-)
diff --git a/dlls/winemac.drv/ime.c b/dlls/winemac.drv/ime.c index 8b89c0089fc..d1d2002fc47 100644 --- a/dlls/winemac.drv/ime.c +++ b/dlls/winemac.drv/ime.c @@ -577,7 +577,7 @@ BOOL WINAPI ImeProcessKey(HIMC hIMC, UINT vKey, LPARAM lKeyData, const LPBYTE lp return FALSE; }
- inIME = macdrv_using_input_method(); + inIME = MACDRV_CALL(ime_using_input_method, NULL); lpIMC = LockRealIMC(hIMC); if (lpIMC) { @@ -658,6 +658,7 @@ BOOL WINAPI ImeSetActiveContext(HIMC hIMC, BOOL fFlag) UINT WINAPI ImeToAsciiEx(UINT uVKey, UINT uScanCode, const LPBYTE lpbKeyState, LPDWORD lpdwTransKey, UINT fuState, HIMC hIMC) { + struct process_text_input_params params; UINT vkey; LPINPUTCONTEXT lpIMC; LPIMEPRIVATE myPrivate; @@ -690,7 +691,13 @@ UINT WINAPI ImeToAsciiEx(UINT uVKey, UINT uScanCode, const LPBYTE lpbKeyState, UnlockRealIMC(hIMC);
TRACE("Processing Mac 0x%04x\n", vkey); - macdrv_process_text_input(uVKey, uScanCode, repeat, lpbKeyState, hIMC, &done); + params.vkey = uVKey; + params.scan = uScanCode; + params.repeat = repeat; + params.key_state = lpbKeyState; + params.himc = hIMC; + params.done = &done; + MACDRV_CALL(ime_process_text_input, ¶ms);
while (!done) MsgWaitForMultipleObjectsEx(0, NULL, INFINITE, QS_POSTMESSAGE | QS_SENDMESSAGE, 0); diff --git a/dlls/winemac.drv/keyboard.c b/dlls/winemac.drv/keyboard.c index 9574b2797b5..181e86afd4a 100644 --- a/dlls/winemac.drv/keyboard.c +++ b/dlls/winemac.drv/keyboard.c @@ -1187,13 +1187,16 @@ void macdrv_hotkey_press(const macdrv_event *event) /*********************************************************************** * macdrv_process_text_input */ -void macdrv_process_text_input(UINT vkey, UINT scan, UINT repeat, const BYTE *key_state, void *himc, int* done) +NTSTATUS macdrv_ime_process_text_input(void *arg) { + struct process_text_input_params *params = arg; struct macdrv_thread_data *thread_data = macdrv_thread_data(); + const BYTE *key_state = params->key_state; unsigned int flags; int keyc;
- TRACE("vkey 0x%04x scan 0x%04x repeat %u himc %p\n", vkey, scan, repeat, himc); + TRACE("vkey 0x%04x scan 0x%04x repeat %u himc %p\n", params->vkey, params->scan, + params->repeat, params->himc);
flags = thread_data->last_modifiers; if (key_state[VK_SHIFT] & 0x80) @@ -1215,17 +1218,19 @@ void macdrv_process_text_input(UINT vkey, UINT scan, UINT repeat, const BYTE *ke
/* Find the Mac keycode corresponding to the scan code */ for (keyc = 0; keyc < ARRAY_SIZE(thread_data->keyc2vkey); keyc++) - if (thread_data->keyc2vkey[keyc] == vkey) break; + if (thread_data->keyc2vkey[keyc] == params->vkey) break;
if (keyc >= ARRAY_SIZE(thread_data->keyc2vkey)) { - *done = -1; - return; + *params->done = -1; + return 0; }
TRACE("flags 0x%08x keyc 0x%04x\n", flags, keyc);
- macdrv_send_text_input_event(((scan & 0x8000) == 0), flags, repeat, keyc, himc, done); + macdrv_send_text_input_event(((params->scan & 0x8000) == 0), flags, params->repeat, keyc, + params->himc, params->done); + return 0; }
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index a4736b2d315..2ea6cd638c3 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -287,8 +287,7 @@ extern NTSTATUS macdrv_init(void *arg) DECLSPEC_HIDDEN; * Mac IME driver */
-extern void macdrv_process_text_input(UINT vkey, UINT scan, UINT repeat, const BYTE *key_state, - void *himc, int* done) DECLSPEC_HIDDEN; +extern NTSTATUS macdrv_ime_process_text_input(void *arg) DECLSPEC_HIDDEN;
extern void macdrv_im_set_text(const macdrv_event *event) DECLSPEC_HIDDEN; extern void macdrv_sent_text_input(const macdrv_event *event) DECLSPEC_HIDDEN; diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c index 6ab7b108909..4a183747796 100644 --- a/dlls/winemac.drv/macdrv_main.c +++ b/dlls/winemac.drv/macdrv_main.c @@ -607,8 +607,16 @@ BOOL macdrv_SystemParametersInfo( UINT action, UINT int_param, void *ptr_param, }
+static NTSTATUS macdrv_ime_using_input_method(void *arg) +{ + return macdrv_using_input_method(); +} + + const unixlib_entry_t __wine_unix_call_funcs[] = { + macdrv_ime_process_text_input, + macdrv_ime_using_input_method, macdrv_init, macdrv_notify_icon, }; diff --git a/dlls/winemac.drv/unixlib.h b/dlls/winemac.drv/unixlib.h index c24f8192142..dc1b314c8cb 100644 --- a/dlls/winemac.drv/unixlib.h +++ b/dlls/winemac.drv/unixlib.h @@ -21,6 +21,8 @@
enum macdrv_funcs { + unix_ime_process_text_input, + unix_ime_using_input_method, unix_init, unix_notify_icon, unix_funcs_count @@ -30,6 +32,17 @@ enum macdrv_funcs extern NTSTATUS unix_call(enum macdrv_funcs code, void *params) DECLSPEC_HIDDEN; #define MACDRV_CALL(func, params) unix_call( unix_ ## func, params )
+/* macdrv_ime_process_text_input params */ +struct process_text_input_params +{ + UINT vkey; + UINT scan; + UINT repeat; + const BYTE *key_state; + void *himc; + int *done; +}; + /* macdrv_init params */ struct localized_string {