Commit a32f0441 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move NtUserActivateKeyboardLayout implementation from user32.

parent 8932c867
......@@ -734,7 +734,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
}
case WM_INPUTLANGCHANGEREQUEST:
ActivateKeyboardLayout( (HKL)lParam, 0 );
NtUserActivateKeyboardLayout( (HKL)lParam, 0 );
break;
case WM_INPUTLANGCHANGE:
......
......@@ -233,11 +233,6 @@ static void CDECL nulldrv_ThreadDetach( void )
* Each entry point simply loads the real driver and chains to it.
*/
static BOOL CDECL loaderdrv_ActivateKeyboardLayout( HKL layout, UINT flags )
{
return load_driver()->pActivateKeyboardLayout( layout, flags );
}
static void CDECL loaderdrv_Beep(void)
{
load_driver()->pBeep();
......@@ -345,7 +340,7 @@ static struct user_driver_funcs lazy_load_driver =
{
{ NULL },
/* keyboard functions */
loaderdrv_ActivateKeyboardLayout,
NULL,
loaderdrv_Beep,
NULL,
loaderdrv_GetKeyboardLayoutList,
......
......@@ -873,36 +873,6 @@ INT WINAPI ToAsciiEx( UINT virtKey, UINT scanCode, const BYTE *lpKeyState,
}
/**********************************************************************
* ActivateKeyboardLayout (USER32.@)
*/
HKL WINAPI ActivateKeyboardLayout( HKL layout, UINT flags )
{
struct user_thread_info *info = get_user_thread_info();
HKL old_layout;
TRACE_(keyboard)( "layout %p, flags %x\n", layout, flags );
if (flags) FIXME_(keyboard)( "flags %x not supported\n", flags );
if (layout == (HKL)HKL_NEXT || layout == (HKL)HKL_PREV)
{
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
FIXME_(keyboard)( "HKL_NEXT and HKL_PREV not supported\n" );
return 0;
}
if (!USER_Driver->pActivateKeyboardLayout( layout, flags ))
return 0;
old_layout = info->kbd_layout;
info->kbd_layout = layout;
if (old_layout != layout) info->kbd_layout_id = 0;
if (!old_layout) return get_locale_kbd_layout();
return old_layout;
}
/**********************************************************************
* BlockInput (USER32.@)
*/
BOOL WINAPI BlockInput(BOOL fBlockIt)
......@@ -1056,7 +1026,7 @@ HKL WINAPI LoadKeyboardLayoutW( const WCHAR *name, UINT flags )
RegCloseKey( hkey );
}
if ((flags & KLF_ACTIVATE) && ActivateKeyboardLayout( layout, 0 )) return layout;
if ((flags & KLF_ACTIVATE) && NtUserActivateKeyboardLayout( layout, 0 )) return layout;
/* FIXME: semi-stub: returning default layout */
return get_locale_kbd_layout();
......
@ stdcall ActivateKeyboardLayout(long long)
@ stdcall ActivateKeyboardLayout(long long) NtUserActivateKeyboardLayout
@ stdcall AddClipboardFormatListener(long) NtUserAddClipboardFormatListener
@ stdcall AdjustWindowRect(ptr long long)
@ stdcall AdjustWindowRectEx(ptr long long long)
......
......@@ -1003,6 +1003,11 @@ static const struct user_driver_funcs *load_driver(void)
return user_driver;
}
static BOOL CDECL loaderdrv_ActivateKeyboardLayout( HKL layout, UINT flags )
{
return load_driver()->pActivateKeyboardLayout( layout, flags );
}
static INT CDECL loaderdrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size )
{
return load_driver()->pGetKeyNameText( lparam, buffer, size );
......@@ -1031,6 +1036,7 @@ static void CDECL loaderdrv_UpdateClipboard(void)
static const struct user_driver_funcs lazy_load_driver =
{
.pActivateKeyboardLayout = loaderdrv_ActivateKeyboardLayout,
.pGetKeyNameText = loaderdrv_GetKeyNameText,
.pMapVirtualKeyEx = loaderdrv_MapVirtualKeyEx,
.pToUnicodeEx = loaderdrv_ToUnicodeEx,
......
......@@ -1167,6 +1167,7 @@ static struct unix_funcs unix_funcs =
NtGdiUnrealizeObject,
NtGdiUpdateColors,
NtGdiWidenPath,
NtUserActivateKeyboardLayout,
NtUserCountClipboardFormats,
NtUserGetKeyNameText,
NtUserGetPriorityClipboardFormat,
......
......@@ -570,3 +570,33 @@ INT WINAPI NtUserToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
TRACE_(keyboard)( "ret %d, str %s.\n", len, debugstr_w(str) );
return len;
}
/**********************************************************************
* NtUserActivateKeyboardLayout (win32u.@)
*/
HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
{
struct user_thread_info *info = get_user_thread_info();
HKL old_layout;
TRACE_(keyboard)( "layout %p, flags %x\n", layout, flags );
if (flags) FIXME_(keyboard)( "flags %x not supported\n", flags );
if (layout == (HKL)HKL_NEXT || layout == (HKL)HKL_PREV)
{
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
FIXME_(keyboard)( "HKL_NEXT and HKL_PREV not supported\n" );
return 0;
}
if (!user_driver->pActivateKeyboardLayout( layout, flags ))
return 0;
old_layout = info->kbd_layout;
info->kbd_layout = layout;
if (old_layout != layout) info->kbd_layout_id = 0;
if (!old_layout) return get_locale_kbd_layout();
return old_layout;
}
......@@ -749,7 +749,7 @@
@ stub NtUpdateInputSinkTransforms
@ stub NtUserAcquireIAMKey
@ stub NtUserAcquireInteractiveControlBackgroundAccess
@ stub NtUserActivateKeyboardLayout
@ stdcall NtUserActivateKeyboardLayout(long long)
@ stdcall -syscall NtUserAddClipboardFormatListener(long)
@ stub NtUserAddVisualIdentifier
@ stub NtUserAlterWindowStyle
......
......@@ -194,6 +194,7 @@ struct unix_funcs
BOOL (WINAPI *pNtGdiUnrealizeObject)( HGDIOBJ obj );
BOOL (WINAPI *pNtGdiUpdateColors)( HDC hdc );
BOOL (WINAPI *pNtGdiWidenPath)( HDC hdc );
HKL (WINAPI *pNtUserActivateKeyboardLayout)( HKL layout, UINT flags );
INT (WINAPI *pNtUserCountClipboardFormats)(void);
INT (WINAPI *pNtUserGetKeyNameText)( LONG lparam, WCHAR *buffer, INT size );
INT (WINAPI *pNtUserGetPriorityClipboardFormat)( UINT *list, INT count );
......
......@@ -596,6 +596,11 @@ NTSTATUS WINAPI NtGdiDdDDISetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER
return unix_funcs->pNtGdiDdDDISetVidPnSourceOwner( desc );
}
HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
{
return unix_funcs->pNtUserActivateKeyboardLayout( layout, flags );
}
INT WINAPI NtUserCountClipboardFormats(void)
{
return unix_funcs->pNtUserCountClipboardFormats();
......
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