Commit 56d0b870 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

win32u: Introduce new NtUserNotifyIMEStatus syscall.

parent e2674379
...@@ -716,6 +716,10 @@ static SHORT nulldrv_VkKeyScanEx( WCHAR ch, HKL layout ) ...@@ -716,6 +716,10 @@ static SHORT nulldrv_VkKeyScanEx( WCHAR ch, HKL layout )
return -256; /* use default implementation */ return -256; /* use default implementation */
} }
static void nulldrv_NotifyIMEStatus( HWND hwnd, UINT status )
{
}
static LRESULT nulldrv_DesktopWindowProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) static LRESULT nulldrv_DesktopWindowProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{ {
return default_window_proc( hwnd, msg, wparam, lparam, FALSE ); return default_window_proc( hwnd, msg, wparam, lparam, FALSE );
...@@ -1070,6 +1074,11 @@ static SHORT loaderdrv_VkKeyScanEx( WCHAR ch, HKL layout ) ...@@ -1070,6 +1074,11 @@ static SHORT loaderdrv_VkKeyScanEx( WCHAR ch, HKL layout )
return load_driver()->pVkKeyScanEx( ch, layout ); return load_driver()->pVkKeyScanEx( ch, layout );
} }
static void loaderdrv_NotifyIMEStatus( HWND hwnd, UINT status )
{
return load_driver()->pNotifyIMEStatus( hwnd, status );
}
static LONG loaderdrv_ChangeDisplaySettings( LPDEVMODEW displays, LPCWSTR primary_name, HWND hwnd, static LONG loaderdrv_ChangeDisplaySettings( LPDEVMODEW displays, LPCWSTR primary_name, HWND hwnd,
DWORD flags, LPVOID lparam ) DWORD flags, LPVOID lparam )
{ {
...@@ -1176,6 +1185,7 @@ static const struct user_driver_funcs lazy_load_driver = ...@@ -1176,6 +1185,7 @@ static const struct user_driver_funcs lazy_load_driver =
loaderdrv_ToUnicodeEx, loaderdrv_ToUnicodeEx,
loaderdrv_UnregisterHotKey, loaderdrv_UnregisterHotKey,
loaderdrv_VkKeyScanEx, loaderdrv_VkKeyScanEx,
loaderdrv_NotifyIMEStatus,
/* cursor/icon functions */ /* cursor/icon functions */
nulldrv_DestroyCursorIcon, nulldrv_DestroyCursorIcon,
loaderdrv_SetCursor, loaderdrv_SetCursor,
...@@ -1255,6 +1265,7 @@ void __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version ...@@ -1255,6 +1265,7 @@ void __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version
SET_USER_FUNC(ToUnicodeEx); SET_USER_FUNC(ToUnicodeEx);
SET_USER_FUNC(UnregisterHotKey); SET_USER_FUNC(UnregisterHotKey);
SET_USER_FUNC(VkKeyScanEx); SET_USER_FUNC(VkKeyScanEx);
SET_USER_FUNC(NotifyIMEStatus);
SET_USER_FUNC(DestroyCursorIcon); SET_USER_FUNC(DestroyCursorIcon);
SET_USER_FUNC(SetCursor); SET_USER_FUNC(SetCursor);
SET_USER_FUNC(GetCursorPos); SET_USER_FUNC(GetCursorPos);
......
...@@ -421,6 +421,14 @@ NTSTATUS WINAPI NtUserBuildHimcList( UINT thread_id, UINT count, HIMC *buffer, U ...@@ -421,6 +421,14 @@ NTSTATUS WINAPI NtUserBuildHimcList( UINT thread_id, UINT count, HIMC *buffer, U
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
/*****************************************************************************
* NtUserNotifyIMEStatus (win32u.@)
*/
void WINAPI NtUserNotifyIMEStatus( HWND hwnd, UINT status )
{
user_driver->pNotifyIMEStatus( hwnd, status );
}
BOOL WINAPI DECLSPEC_HIDDEN ImmProcessKey( HWND hwnd, HKL hkl, UINT vkey, LPARAM key_data, DWORD unknown ) BOOL WINAPI DECLSPEC_HIDDEN ImmProcessKey( HWND hwnd, HKL hkl, UINT vkey, LPARAM key_data, DWORD unknown )
{ {
struct imm_process_key_params params = struct imm_process_key_params params =
......
...@@ -233,6 +233,7 @@ static void * const syscalls[] = ...@@ -233,6 +233,7 @@ static void * const syscalls[] =
NtUserMessageCall, NtUserMessageCall,
NtUserMoveWindow, NtUserMoveWindow,
NtUserMsgWaitForMultipleObjectsEx, NtUserMsgWaitForMultipleObjectsEx,
NtUserNotifyIMEStatus,
NtUserNotifyWinEvent, NtUserNotifyWinEvent,
NtUserOpenClipboard, NtUserOpenClipboard,
NtUserOpenDesktop, NtUserOpenDesktop,
......
...@@ -1087,7 +1087,7 @@ ...@@ -1087,7 +1087,7 @@
@ stdcall -syscall NtUserMoveWindow(long long long long long long) @ stdcall -syscall NtUserMoveWindow(long long long long long long)
@ stdcall -syscall NtUserMsgWaitForMultipleObjectsEx(long ptr long long long) @ stdcall -syscall NtUserMsgWaitForMultipleObjectsEx(long ptr long long long)
@ stub NtUserNavigateFocus @ stub NtUserNavigateFocus
@ stub NtUserNotifyIMEStatus @ stdcall -syscall NtUserNotifyIMEStatus(long long)
@ stub NtUserNotifyProcessCreate @ stub NtUserNotifyProcessCreate
@ stdcall -syscall NtUserNotifyWinEvent(long long long long) @ stdcall -syscall NtUserNotifyWinEvent(long long long long)
@ stdcall -syscall NtUserOpenClipboard(long long) @ stdcall -syscall NtUserOpenClipboard(long long)
......
...@@ -531,7 +531,6 @@ UINT WINAPI ImeToAsciiEx (UINT uVKey, UINT uScanCode, const LPBYTE lpbKeyState, ...@@ -531,7 +531,6 @@ UINT WINAPI ImeToAsciiEx (UINT uVKey, UINT uScanCode, const LPBYTE lpbKeyState,
BOOL WINAPI NotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue) BOOL WINAPI NotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
{ {
struct xim_preedit_state_params preedit_params;
BOOL bRet = FALSE; BOOL bRet = FALSE;
LPINPUTCONTEXT lpIMC; LPINPUTCONTEXT lpIMC;
...@@ -572,16 +571,13 @@ BOOL WINAPI NotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue) ...@@ -572,16 +571,13 @@ BOOL WINAPI NotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
} }
break; break;
case IMC_SETOPENSTATUS: case IMC_SETOPENSTATUS:
bRet = TRUE;
preedit_params.hwnd = lpIMC->hWnd;
preedit_params.open = lpIMC->fOpen;
X11DRV_CALL( xim_preedit_state, &preedit_params );
if (!lpIMC->fOpen) if (!lpIMC->fOpen)
{ {
X11DRV_CALL( xim_reset, lpIMC->hWnd );
input_context_reset_comp_str( lpIMC ); input_context_reset_comp_str( lpIMC );
ime_set_composition_status( hIMC, FALSE ); ime_set_composition_status( hIMC, FALSE );
} }
NtUserNotifyIMEStatus( lpIMC->hWnd, lpIMC->fOpen );
bRet = TRUE;
break; break;
default: FIXME("Unknown\n"); break; default: FIXME("Unknown\n"); break;
} }
......
...@@ -398,6 +398,7 @@ static const struct user_driver_funcs x11drv_funcs = ...@@ -398,6 +398,7 @@ static const struct user_driver_funcs x11drv_funcs =
.pMapVirtualKeyEx = X11DRV_MapVirtualKeyEx, .pMapVirtualKeyEx = X11DRV_MapVirtualKeyEx,
.pToUnicodeEx = X11DRV_ToUnicodeEx, .pToUnicodeEx = X11DRV_ToUnicodeEx,
.pVkKeyScanEx = X11DRV_VkKeyScanEx, .pVkKeyScanEx = X11DRV_VkKeyScanEx,
.pNotifyIMEStatus = X11DRV_NotifyIMEStatus,
.pDestroyCursorIcon = X11DRV_DestroyCursorIcon, .pDestroyCursorIcon = X11DRV_DestroyCursorIcon,
.pSetCursor = X11DRV_SetCursor, .pSetCursor = X11DRV_SetCursor,
.pGetCursorPos = X11DRV_GetCursorPos, .pGetCursorPos = X11DRV_GetCursorPos,
......
...@@ -31,8 +31,6 @@ enum x11drv_funcs ...@@ -31,8 +31,6 @@ enum x11drv_funcs
unix_tablet_get_packet, unix_tablet_get_packet,
unix_tablet_info, unix_tablet_info,
unix_tablet_load_info, unix_tablet_load_info,
unix_xim_preedit_state,
unix_xim_reset,
unix_funcs_count, unix_funcs_count,
}; };
......
...@@ -209,6 +209,7 @@ extern UINT X11DRV_MapVirtualKeyEx( UINT code, UINT map_type, HKL hkl ) DECLSPEC ...@@ -209,6 +209,7 @@ extern UINT X11DRV_MapVirtualKeyEx( UINT code, UINT map_type, HKL hkl ) DECLSPEC
extern INT X11DRV_ToUnicodeEx( UINT virtKey, UINT scanCode, const BYTE *lpKeyState, extern INT X11DRV_ToUnicodeEx( UINT virtKey, UINT scanCode, const BYTE *lpKeyState,
LPWSTR bufW, int bufW_size, UINT flags, HKL hkl ) DECLSPEC_HIDDEN; LPWSTR bufW, int bufW_size, UINT flags, HKL hkl ) DECLSPEC_HIDDEN;
extern SHORT X11DRV_VkKeyScanEx( WCHAR wChar, HKL hkl ) DECLSPEC_HIDDEN; extern SHORT X11DRV_VkKeyScanEx( WCHAR wChar, HKL hkl ) DECLSPEC_HIDDEN;
extern void X11DRV_NotifyIMEStatus( HWND hwnd, UINT status ) DECLSPEC_HIDDEN;
extern void X11DRV_DestroyCursorIcon( HCURSOR handle ) DECLSPEC_HIDDEN; extern void X11DRV_DestroyCursorIcon( HCURSOR handle ) DECLSPEC_HIDDEN;
extern void X11DRV_SetCursor( HCURSOR handle ) DECLSPEC_HIDDEN; extern void X11DRV_SetCursor( HCURSOR handle ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_SetCursorPos( INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL X11DRV_SetCursorPos( INT x, INT y ) DECLSPEC_HIDDEN;
...@@ -848,8 +849,6 @@ extern NTSTATUS x11drv_tablet_attach_queue( void *arg ) DECLSPEC_HIDDEN; ...@@ -848,8 +849,6 @@ extern NTSTATUS x11drv_tablet_attach_queue( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_tablet_get_packet( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS x11drv_tablet_get_packet( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_tablet_load_info( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS x11drv_tablet_load_info( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_tablet_info( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS x11drv_tablet_info( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_xim_preedit_state( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_xim_reset( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_client_func( enum x11drv_client_funcs func, const void *params, extern NTSTATUS x11drv_client_func( enum x11drv_client_funcs func, const void *params,
ULONG size ) DECLSPEC_HIDDEN; ULONG size ) DECLSPEC_HIDDEN;
......
...@@ -1330,8 +1330,6 @@ const unixlib_entry_t __wine_unix_call_funcs[] = ...@@ -1330,8 +1330,6 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
x11drv_tablet_get_packet, x11drv_tablet_get_packet,
x11drv_tablet_info, x11drv_tablet_info,
x11drv_tablet_load_info, x11drv_tablet_load_info,
x11drv_xim_preedit_state,
x11drv_xim_reset,
}; };
...@@ -1408,20 +1406,6 @@ static NTSTATUS x11drv_wow64_tablet_info( void *arg ) ...@@ -1408,20 +1406,6 @@ static NTSTATUS x11drv_wow64_tablet_info( void *arg )
return x11drv_tablet_info( &params ); return x11drv_tablet_info( &params );
} }
static NTSTATUS x11drv_wow64_xim_preedit_state( void *arg )
{
struct
{
ULONG hwnd;
BOOL open;
} *params32 = arg;
struct xim_preedit_state_params params;
params.hwnd = UlongToHandle( params32->hwnd );
params.open = params32->open;
return x11drv_xim_preedit_state( &params );
}
const unixlib_entry_t __wine_unix_call_wow64_funcs[] = const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
{ {
x11drv_create_desktop, x11drv_create_desktop,
...@@ -1434,8 +1418,6 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = ...@@ -1434,8 +1418,6 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
x11drv_wow64_tablet_get_packet, x11drv_wow64_tablet_get_packet,
x11drv_wow64_tablet_info, x11drv_wow64_tablet_info,
x11drv_tablet_load_info, x11drv_tablet_load_info,
x11drv_wow64_xim_preedit_state,
x11drv_xim_reset,
}; };
C_ASSERT( ARRAYSIZE(__wine_unix_call_wow64_funcs) == unix_funcs_count ); C_ASSERT( ARRAYSIZE(__wine_unix_call_wow64_funcs) == unix_funcs_count );
......
...@@ -260,42 +260,26 @@ static int xic_status_draw( XIC xic, XPointer user, XPointer arg ) ...@@ -260,42 +260,26 @@ static int xic_status_draw( XIC xic, XPointer user, XPointer arg )
return 0; return 0;
} }
NTSTATUS x11drv_xim_reset( void *hwnd ) /***********************************************************************
{ * NotifyIMEStatus (X11DRV.@)
XIC ic = X11DRV_get_ic(hwnd); */
if (ic) void X11DRV_NotifyIMEStatus( HWND hwnd, UINT status )
{
char* leftover;
TRACE("Forcing Reset %p\n",ic);
leftover = XmbResetIC(ic);
XFree(leftover);
}
return 0;
}
NTSTATUS x11drv_xim_preedit_state( void *arg )
{ {
struct xim_preedit_state_params *params = arg; XIMPreeditState state = status ? XIMPreeditEnable : XIMPreeditDisable;
XIC ic;
XIMPreeditState state;
XVaNestedList attr; XVaNestedList attr;
XIC xic;
ic = X11DRV_get_ic( params->hwnd ); TRACE( "hwnd %p, status %#x\n", hwnd, status );
if (!ic)
return 0;
if (params->open) if (!(xic = X11DRV_get_ic( hwnd ))) return;
state = XIMPreeditEnable;
else
state = XIMPreeditDisable;
attr = XVaCreateNestedList(0, XNPreeditState, state, NULL); if ((attr = XVaCreateNestedList( 0, XNPreeditState, state, NULL )))
if (attr != NULL)
{ {
XSetICValues(ic, XNPreeditAttributes, attr, NULL); XSetICValues( xic, XNPreeditAttributes, attr, NULL );
XFree(attr); XFree( attr );
} }
return 0;
if (!status) XFree( XmbResetIC( xic ) );
} }
/*********************************************************************** /***********************************************************************
......
...@@ -219,6 +219,7 @@ ...@@ -219,6 +219,7 @@
SYSCALL_ENTRY( NtUserMessageCall ) \ SYSCALL_ENTRY( NtUserMessageCall ) \
SYSCALL_ENTRY( NtUserMoveWindow ) \ SYSCALL_ENTRY( NtUserMoveWindow ) \
SYSCALL_ENTRY( NtUserMsgWaitForMultipleObjectsEx ) \ SYSCALL_ENTRY( NtUserMsgWaitForMultipleObjectsEx ) \
SYSCALL_ENTRY( NtUserNotifyIMEStatus ) \
SYSCALL_ENTRY( NtUserNotifyWinEvent ) \ SYSCALL_ENTRY( NtUserNotifyWinEvent ) \
SYSCALL_ENTRY( NtUserOpenClipboard ) \ SYSCALL_ENTRY( NtUserOpenClipboard ) \
SYSCALL_ENTRY( NtUserOpenDesktop ) \ SYSCALL_ENTRY( NtUserOpenDesktop ) \
......
...@@ -3154,6 +3154,15 @@ NTSTATUS WINAPI wow64_NtUserMsgWaitForMultipleObjectsEx( UINT *args ) ...@@ -3154,6 +3154,15 @@ NTSTATUS WINAPI wow64_NtUserMsgWaitForMultipleObjectsEx( UINT *args )
return NtUserMsgWaitForMultipleObjectsEx( count, handles, timeout, mask, flags ); return NtUserMsgWaitForMultipleObjectsEx( count, handles, timeout, mask, flags );
} }
NTSTATUS WINAPI wow64_NtUserNotifyIMEStatus( UINT *args )
{
HWND hwnd = get_handle( &args );
ULONG status = get_ulong( &args );
NtUserNotifyIMEStatus( hwnd, status );
return 0;
}
NTSTATUS WINAPI wow64_NtUserNotifyWinEvent( UINT *args ) NTSTATUS WINAPI wow64_NtUserNotifyWinEvent( UINT *args )
{ {
DWORD event = get_ulong( &args ); DWORD event = get_ulong( &args );
......
...@@ -817,6 +817,7 @@ LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa ...@@ -817,6 +817,7 @@ LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa
BOOL WINAPI NtUserMoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy, BOOL repaint ); BOOL WINAPI NtUserMoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy, BOOL repaint );
DWORD WINAPI NtUserMsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD WINAPI NtUserMsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles,
DWORD timeout, DWORD mask, DWORD flags ); DWORD timeout, DWORD mask, DWORD flags );
void WINAPI NtUserNotifyIMEStatus( HWND hwnd, UINT status );
void WINAPI NtUserNotifyWinEvent( DWORD event, HWND hwnd, LONG object_id, LONG child_id ); void WINAPI NtUserNotifyWinEvent( DWORD event, HWND hwnd, LONG object_id, LONG child_id );
HWINSTA WINAPI NtUserOpenWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK access ); HWINSTA WINAPI NtUserOpenWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK access );
BOOL WINAPI NtUserOpenClipboard( HWND hwnd, ULONG unk ); BOOL WINAPI NtUserOpenClipboard( HWND hwnd, ULONG unk );
......
...@@ -287,6 +287,8 @@ struct user_driver_funcs ...@@ -287,6 +287,8 @@ struct user_driver_funcs
INT (*pToUnicodeEx)(UINT,UINT,const BYTE *,LPWSTR,int,UINT,HKL); INT (*pToUnicodeEx)(UINT,UINT,const BYTE *,LPWSTR,int,UINT,HKL);
void (*pUnregisterHotKey)(HWND, UINT, UINT); void (*pUnregisterHotKey)(HWND, UINT, UINT);
SHORT (*pVkKeyScanEx)(WCHAR, HKL); SHORT (*pVkKeyScanEx)(WCHAR, HKL);
/* IME functions */
void (*pNotifyIMEStatus)(HWND,UINT);
/* cursor/icon functions */ /* cursor/icon functions */
void (*pDestroyCursorIcon)(HCURSOR); void (*pDestroyCursorIcon)(HCURSOR);
void (*pSetCursor)(HCURSOR); void (*pSetCursor)(HCURSOR);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment