libfreerdp-locale: fix C++ header

This commit is contained in:
Marc-André Moreau 2013-04-28 20:16:04 -04:00
parent 7cf23aff02
commit fc3324151c
2 changed files with 34 additions and 0 deletions

View File

@ -199,10 +199,19 @@ typedef struct _RDP_KEYBOARD_LAYOUT RDP_KEYBOARD_LAYOUT;
#define KBD_TYPE_NOKIA_9140 0x00000006 /* Nokia 9140 and similar keyboards */
#define KBD_TYPE_JAPANESE 0x00000007 /* Japanese keyboard */
#ifdef __cplusplus
extern "C" {
#endif
FREERDP_API DWORD freerdp_keyboard_init(DWORD keyboardLayoutId);
FREERDP_API RDP_KEYBOARD_LAYOUT* freerdp_keyboard_get_layouts(DWORD types);
FREERDP_API const char* freerdp_keyboard_get_layout_name_from_id(DWORD keyboardLayoutId);
FREERDP_API DWORD freerdp_keyboard_get_layout_id_from_name(const char* name);
FREERDP_API DWORD freerdp_keyboard_get_rdp_scancode_from_x11_keycode(DWORD keycode);
FREERDP_API DWORD freerdp_keyboard_get_x11_keycode_from_rdp_scancode(DWORD scancode, BOOL extended);
#ifdef __cplusplus
}
#endif
#endif /* FREERDP_LOCALE_KEYBOARD_H */

View File

@ -285,3 +285,28 @@ const char* freerdp_keyboard_get_layout_name_from_id(DWORD keyboardLayoutID)
return "unknown";
}
DWORD freerdp_keyboard_get_layout_id_from_name(const char* name)
{
int i;
for (i = 0; i < ARRAYSIZE(RDP_KEYBOARD_LAYOUT_TABLE); i++)
{
if (strcmp(RDP_KEYBOARD_LAYOUT_TABLE[i].name, name) == 0)
return RDP_KEYBOARD_LAYOUT_TABLE[i].code;
}
for (i = 0; i < ARRAYSIZE(RDP_KEYBOARD_LAYOUT_VARIANT_TABLE); i++)
{
if (strcmp(RDP_KEYBOARD_LAYOUT_VARIANT_TABLE[i].name, name) == 0)
return RDP_KEYBOARD_LAYOUT_VARIANT_TABLE[i].code;
}
for (i = 0; i < ARRAYSIZE(RDP_KEYBOARD_IME_TABLE); i++)
{
if (strcmp(RDP_KEYBOARD_IME_TABLE[i].name, name) == 0)
return RDP_KEYBOARD_IME_TABLE[i].code;
}
return 0;
}