Commit b0c2e54a authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Add preliminary support for keyboard layout APIs.

parent 2d00b08a
......@@ -35,10 +35,10 @@
# USER driver
@ cdecl VkKeyScan(long) TTYDRV_VkKeyScan
@ cdecl MapVirtualKey(long long) TTYDRV_MapVirtualKey
@ cdecl GetKeyNameText(long str long) TTYDRV_GetKeyNameText
@ cdecl ToUnicode(long long ptr ptr long long) TTYDRV_ToUnicode
@ cdecl VkKeyScanEx(long long) TTYDRV_VkKeyScanEx
@ cdecl MapVirtualKeyEx(long long long) TTYDRV_MapVirtualKeyEx
@ cdecl GetKeyNameText(long ptr long) TTYDRV_GetKeyNameText
@ cdecl ToUnicodeEx(long long ptr ptr long long long) TTYDRV_ToUnicodeEx
@ cdecl Beep() TTYDRV_Beep
@ cdecl SetCursor(ptr) TTYDRV_SetCursor
@ cdecl GetScreenSaveActive() TTYDRV_GetScreenSaveActive
......
......@@ -34,17 +34,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(ttydrv);
struct tagCURSORICONINFO;
/***********************************************************************
* VkKeyScan (TTYDRV.@)
* VkKeyScanEx (TTYDRV.@)
*/
WORD TTYDRV_VkKeyScan(CHAR cChar)
SHORT TTYDRV_VkKeyScanEx(WCHAR cChar, HKL hkl)
{
return 0;
}
/***********************************************************************
* MapVirtualKey (TTYDRV.@)
* MapVirtualKeyEx (TTYDRV.@)
*/
UINT16 TTYDRV_MapVirtualKey(UINT16 wCode, UINT16 wMapType)
UINT TTYDRV_MapVirtualKeyEx(UINT wCode, UINT wMapType, HKL hkl)
{
return 0;
}
......@@ -52,7 +52,7 @@ UINT16 TTYDRV_MapVirtualKey(UINT16 wCode, UINT16 wMapType)
/***********************************************************************
* GetKeyNameText (TTYDRV.@)
*/
INT16 TTYDRV_GetKeyNameText( LONG lParam, LPSTR lpBuffer, INT16 nSize )
INT TTYDRV_GetKeyNameText( LONG lParam, LPWSTR lpBuffer, INT nSize )
{
if(lpBuffer && nSize)
{
......@@ -62,10 +62,10 @@ INT16 TTYDRV_GetKeyNameText( LONG lParam, LPSTR lpBuffer, INT16 nSize )
}
/***********************************************************************
* ToUnicode (TTYDRV.@)
* ToUnicodeEx (TTYDRV.@)
*/
INT TTYDRV_ToUnicode( UINT virtKey, UINT scanCode, LPBYTE lpKeyState,
LPWSTR pwszBuff, int cchBuff, UINT flags )
INT TTYDRV_ToUnicodeEx( UINT virtKey, UINT scanCode, LPBYTE lpKeyState,
LPWSTR pwszBuff, int cchBuff, UINT flags, HKL hkl )
{
return 0;
}
......
......@@ -591,7 +591,7 @@
@ stdcall UnhookWindowsHook(long ptr)
@ stdcall UnhookWindowsHookEx(long)
@ stdcall UnionRect(ptr ptr ptr)
@ stub UnloadKeyboardLayout
@ stdcall UnloadKeyboardLayout(long)
@ stub UnlockWindowStation
@ stdcall UnpackDDElParam(long long ptr ptr)
@ stdcall UnregisterClassA(str long)
......
......@@ -76,10 +76,16 @@ static BOOL load_driver(void)
}
GET_USER_FUNC(InitKeyboard);
GET_USER_FUNC(VkKeyScan);
GET_USER_FUNC(MapVirtualKey);
GET_USER_FUNC(VkKeyScanEx);
GET_USER_FUNC(MapVirtualKeyEx);
GET_USER_FUNC(GetKeyNameText);
GET_USER_FUNC(ToUnicode);
GET_USER_FUNC(ToUnicodeEx);
GET_USER_FUNC(GetKeyboardLayoutList);
GET_USER_FUNC(GetKeyboardLayout);
GET_USER_FUNC(GetKeyboardLayoutName);
GET_USER_FUNC(LoadKeyboardLayout);
GET_USER_FUNC(ActivateKeyboardLayout);
GET_USER_FUNC(UnloadKeyboardLayout);
GET_USER_FUNC(Beep);
GET_USER_FUNC(InitMouse);
GET_USER_FUNC(SetCursor);
......
......@@ -6,7 +6,7 @@ VPATH = @srcdir@
MODULE = x11drv.dll
IMPORTS = user32 gdi32 advapi32 kernel32 ntdll
EXTRAINCL = @X_CFLAGS@
EXTRALIBS = @X_LIBS@ @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@
EXTRALIBS = $(LIBUNICODE) @X_LIBS@ @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@
C_SRCS = \
$(TOPOBJDIR)/graphics/x11drv/bitblt.c \
......
......@@ -63,10 +63,16 @@
# USER driver
@ cdecl InitKeyboard(ptr) X11DRV_InitKeyboard
@ cdecl VkKeyScan(long) X11DRV_VkKeyScan
@ cdecl MapVirtualKey(long long) X11DRV_MapVirtualKey
@ cdecl GetKeyNameText(long str long) X11DRV_GetKeyNameText
@ cdecl ToUnicode(long long ptr ptr long long) X11DRV_ToUnicode
@ cdecl VkKeyScanEx(long long) X11DRV_VkKeyScanEx
@ cdecl MapVirtualKeyEx(long long long) X11DRV_MapVirtualKeyEx
@ cdecl GetKeyNameText(long ptr long) X11DRV_GetKeyNameText
@ cdecl ToUnicodeEx(long long ptr ptr long long long) X11DRV_ToUnicodeEx
@ cdecl GetKeyboardLayoutList(long ptr) X11DRV_GetKeyboardLayoutList
@ cdecl GetKeyboardLayout(long) X11DRV_GetKeyboardLayout
@ cdecl GetKeyboardLayoutName(ptr) X11DRV_GetKeyboardLayoutName
@ cdecl LoadKeyboardLayout(wstr long) X11DRV_LoadKeyboardLayout
@ cdecl ActivateKeyboardLayout(long long) X11DRV_ActivateKeyboardLayout
@ cdecl UnloadKeyboardLayout(long) X11DRV_UnloadKeyboardLayout
@ cdecl Beep() X11DRV_Beep
@ cdecl InitMouse(ptr) X11DRV_InitMouse
@ cdecl SetCursor(ptr) X11DRV_SetCursor
......
......@@ -72,10 +72,16 @@ enum wine_internal_message
typedef struct tagUSER_DRIVER {
/* keyboard functions */
void (*pInitKeyboard)(LPBYTE);
WORD (*pVkKeyScan)(CHAR);
UINT (*pMapVirtualKey)(UINT,UINT);
INT (*pGetKeyNameText)(LONG,LPSTR,INT);
INT (*pToUnicode)(UINT, UINT, LPBYTE, LPWSTR, int, UINT);
SHORT (*pVkKeyScanEx)(WCHAR, HKL);
UINT (*pMapVirtualKeyEx)(UINT, UINT, HKL);
INT (*pGetKeyNameText)(LONG, LPWSTR, INT);
INT (*pToUnicodeEx)(UINT, UINT, LPBYTE, LPWSTR, int, UINT, HKL);
UINT (*pGetKeyboardLayoutList)(INT, HKL *);
HKL (*pGetKeyboardLayout)(DWORD);
BOOL (*pGetKeyboardLayoutName)(LPWSTR);
HKL (*pLoadKeyboardLayout)(LPCWSTR, UINT);
HKL (*pActivateKeyboardLayout)(HKL, UINT);
BOOL (*pUnloadKeyboardLayout)(HKL);
void (*pBeep)(void);
/* mouse functions */
void (*pInitMouse)(LPBYTE);
......
......@@ -3714,7 +3714,7 @@ BOOL WINAPI EnumThreadWindows(DWORD,WNDENUMPROC,LPARAM);
BOOL WINAPI ExitWindowsEx(UINT,DWORD);
BOOL WINAPI GetIconInfo(HICON,PICONINFO);
HKL WINAPI GetKeyboardLayout(DWORD);
INT WINAPI GetKeyboardLayoutList(INT,HKL *);
UINT WINAPI GetKeyboardLayoutList(INT,HKL *);
BOOL WINAPI GetComboBoxInfo(HWND,PCOMBOBOXINFO);
DWORD WINAPI GetMenuContextHelpId(HMENU);
UINT WINAPI GetMenuDefaultItem(HMENU,UINT,UINT);
......@@ -3767,9 +3767,11 @@ HWINEVENTHOOK WINAPI SetWinEventHook(DWORD,DWORD,HMODULE,WINEVENTPROC,DWORD,DWOR
WORD WINAPI TileWindows (HWND, UINT, const LPRECT,
UINT, const HWND *);
INT WINAPI ToUnicode(UINT,UINT,PBYTE,LPWSTR,int,UINT);
INT WINAPI ToUnicodeEx(UINT,UINT,LPBYTE,LPWSTR,int,UINT,HKL);
BOOL WINAPI TrackPopupMenuEx(HMENU,UINT,INT,INT,HWND,
LPTPMPARAMS);
BOOL WINAPI UnhookWinEvent(HWINEVENTHOOK);
BOOL WINAPI UnloadKeyboardLayout(HKL);
BOOL WINAPI UnregisterDeviceNotification(HDEVNOTIFY);
BOOL WINAPI UnregisterHotKey(HWND,INT);
DWORD WINAPI WaitForInputIdle(HANDLE,DWORD);
......@@ -4077,8 +4079,8 @@ INT WINAPI GetKeyboardType(INT);
INT WINAPI GetKeyNameTextA(LONG,LPSTR,INT);
INT WINAPI GetKeyNameTextW(LONG,LPWSTR,INT);
#define GetKeyNameText WINELIB_NAME_AW(GetKeyNameText)
INT WINAPI GetKeyboardLayoutNameA(LPSTR);
INT WINAPI GetKeyboardLayoutNameW(LPWSTR);
BOOL WINAPI GetKeyboardLayoutNameA(LPSTR);
BOOL WINAPI GetKeyboardLayoutNameW(LPWSTR);
#define GetKeyboardLayoutName WINELIB_NAME_AW(GetKeyboardLayoutName)
SHORT WINAPI GetKeyState(INT);
HWND WINAPI GetLastActivePopup(HWND);
......@@ -4399,8 +4401,8 @@ BOOL WINAPI UpdateWindow(HWND);
UINT WINAPI UserRealizePalette(HDC);
BOOL WINAPI ValidateRect(HWND,const RECT*);
BOOL WINAPI ValidateRgn(HWND,HRGN);
WORD WINAPI VkKeyScanA(CHAR);
WORD WINAPI VkKeyScanW(WCHAR);
SHORT WINAPI VkKeyScanA(CHAR);
SHORT WINAPI VkKeyScanW(WCHAR);
#define VkKeyScan WINELIB_NAME_AW(VkKeyScan)
WORD WINAPI VkKeyScanExA(CHAR, HKL);
WORD WINAPI VkKeyScanExW(WCHAR, HKL);
......
......@@ -859,6 +859,14 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
}
break;
case WM_INPUTLANGCHANGEREQUEST:
/* notify about the switch only if it's really our current layout */
if ((HKL)lParam == GetKeyboardLayout(0))
result = SendMessageA( hwnd, WM_INPUTLANGCHANGE, wParam, lParam );
else
result = 0;
break;
default:
result = DEFWND_DefWinProc( hwnd, msg, wParam, lParam );
break;
......@@ -970,6 +978,14 @@ LRESULT WINAPI DefWindowProcW(
}
break;
case WM_INPUTLANGCHANGEREQUEST:
/* notify about the switch only if it's really our current layout */
if ((HKL)lParam == GetKeyboardLayout(0))
result = SendMessageW( hwnd, WM_INPUTLANGCHANGE, wParam, lParam );
else
result = 0;
break;
default:
result = DEFWND_DefWinProc( hwnd, msg, wParam, lParam );
break;
......
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