kbd: fix incorrect word replacement.

This commit is contained in:
Vic Lee 2011-07-07 11:25:04 +08:00
parent fb27e0d072
commit 561d4266d9
11 changed files with 39 additions and 39 deletions

View File

@ -22,11 +22,11 @@
#include <freerdp/types/base.h>
#define RDP_KEYBOAFRDP_LAYOUT_TYPE_STANDARD 1
#define RDP_KEYBOAFRDP_LAYOUT_TYPE_VARIANT 2
#define RDP_KEYBOAFRDP_LAYOUT_TYPE_IME 4
#define RDP_KEYBOARD_LAYOUT_TYPE_STANDARD 1
#define RDP_KEYBOARD_LAYOUT_TYPE_VARIANT 2
#define RDP_KEYBOARD_LAYOUT_TYPE_IME 4
typedef struct rdp_keyboaFRDP_layout
typedef struct rdp_keyboard_layout
{
uint32 code;
char name[50];
@ -35,7 +35,7 @@ typedef struct rdp_keyboaFRDP_layout
rdpKeyboardLayout *
freerdp_kbd_get_layouts(int types);
unsigned int
freerdp_kbd_init(void *dpy, unsigned int keyboaFRDP_layout_id);
freerdp_kbd_init(void *dpy, unsigned int keyboard_layout_id);
uint8
freerdp_kbd_get_scancode_by_keycode(uint8 keycode, boolean * extended);
uint8

View File

@ -19,8 +19,8 @@
/* Microsoft Windows Virtual Key Codes: http://msdn.microsoft.com/en-us/library/ms645540.aspx */
#ifndef __KEYBOAFRDP_H
#define __KEYBOAFRDP_H
#ifndef __KEYBOARD_H
#define __KEYBOARD_H
#include <stddef.h>
@ -584,4 +584,4 @@ static const virtualKey virtualKeyboard[256 + 2] =
{ 0x1C, 1, "" , "KPEN" },
};
#endif /* __KEYBOAFRDP_H */
#endif /* __KEYBOARD_H */

View File

@ -230,7 +230,7 @@ keyboardIME keyboardIMEs[] =
rdpKeyboardLayout *
get_keyboaFRDP_layouts(int types)
get_keyboard_layouts(int types)
{
rdpKeyboardLayout * layouts;
int num;
@ -240,7 +240,7 @@ get_keyboaFRDP_layouts(int types)
num = 0;
layouts = (rdpKeyboardLayout *) malloc((num + 1) * sizeof(rdpKeyboardLayout));
if ((types & RDP_KEYBOAFRDP_LAYOUT_TYPE_STANDARD) != 0)
if ((types & RDP_KEYBOARD_LAYOUT_TYPE_STANDARD) != 0)
{
len = sizeof(keyboardLayouts) / sizeof(keyboardLayout);
layouts = (rdpKeyboardLayout *) realloc(layouts, (num + len + 1) * sizeof(rdpKeyboardLayout));
@ -250,7 +250,7 @@ get_keyboaFRDP_layouts(int types)
strcpy(layouts[num].name, keyboardLayouts[i].name);
}
}
if ((types & RDP_KEYBOAFRDP_LAYOUT_TYPE_VARIANT) != 0)
if ((types & RDP_KEYBOARD_LAYOUT_TYPE_VARIANT) != 0)
{
len = sizeof(keyboardLayoutVariants) / sizeof(keyboardLayoutVariant);
layouts = (rdpKeyboardLayout *) realloc(layouts, (num + len + 1) * sizeof(rdpKeyboardLayout));
@ -260,7 +260,7 @@ get_keyboaFRDP_layouts(int types)
strcpy(layouts[num].name, keyboardLayoutVariants[i].name);
}
}
if ((types & RDP_KEYBOAFRDP_LAYOUT_TYPE_IME) != 0)
if ((types & RDP_KEYBOARD_LAYOUT_TYPE_IME) != 0)
{
len = sizeof(keyboardIMEs) / sizeof(keyboardIME);
layouts = (rdpKeyboardLayout *) realloc(layouts, (num + len + 1) * sizeof(rdpKeyboardLayout));

View File

@ -178,7 +178,7 @@
#define KBD_CHINESE_TRADITIONAL_ALPHANUMERIC 0xE00F0404
rdpKeyboardLayout *
get_keyboaFRDP_layouts(int types);
get_keyboard_layouts(int types);
char *
get_layout_name(unsigned int keyboardLayoutID);

View File

@ -57,10 +57,10 @@ comma_substring(char *s, int n)
}
unsigned int
detect_keyboaFRDP_layout_from_xkb(void *dpy)
detect_keyboard_layout_from_xkb(void *dpy)
{
char *layout, *variant;
unsigned int keyboaFRDP_layout = 0, group = 0;
unsigned int keyboard_layout = 0, group = 0;
XkbRF_VarDefsRec rules_names;
XKeyboardState coreKbdState;
XkbStateRec state;
@ -82,7 +82,7 @@ detect_keyboaFRDP_layout_from_xkb(void *dpy)
DEBUG_KBD("layout: %s", layout);
DEBUG_KBD("variant: %s", variant);
keyboaFRDP_layout = find_keyboaFRDP_layout_in_xorg_rules(layout, variant);
keyboard_layout = find_keyboard_layout_in_xorg_rules(layout, variant);
free(rules_names.model);
free(rules_names.layout);
@ -90,7 +90,7 @@ detect_keyboaFRDP_layout_from_xkb(void *dpy)
free(rules_names.options);
}
return keyboaFRDP_layout;
return keyboard_layout;
}
int
@ -358,7 +358,7 @@ load_xkb_keyboard(KeycodeToVkcode map, char* kbd)
}
void
load_keyboaFRDP_map(KeycodeToVkcode keycodeToVkcode, char *xkbfile)
load_keyboard_map(KeycodeToVkcode keycodeToVkcode, char *xkbfile)
{
char* kbd;
char* xkbfileEnd;

View File

@ -37,7 +37,7 @@ int
init_xkb(void *dpy);
unsigned int
detect_keyboaFRDP_layout_from_xkb(void *dpy);
detect_keyboard_layout_from_xkb(void *dpy);
int
init_keycodes_from_xkb(void *dpy, RdpKeycodes x_keycode_to_rdp_keycode);
@ -45,7 +45,7 @@ init_keycodes_from_xkb(void *dpy, RdpKeycodes x_keycode_to_rdp_keycode);
#else
void
load_keyboaFRDP_map(KeycodeToVkcode keycodeToVkcode, char *xkbfile);
load_keyboard_map(KeycodeToVkcode keycodeToVkcode, char *xkbfile);
#endif

View File

@ -52,15 +52,15 @@ detect_keyboard(void *dpy, unsigned int keyboardLayoutID, char *xkbfile, size_t
#if defined(sun)
if(keyboardLayoutID == 0)
{
keyboardLayoutID = detect_keyboaFRDP_type_and_layout_sunos(xkbfile, xkbfilelength);
DEBUG_KBD("detect_keyboaFRDP_type_and_layout_sunos: %X %s", keyboardLayoutID, xkbfile);
keyboardLayoutID = detect_keyboard_type_and_layout_sunos(xkbfile, xkbfilelength);
DEBUG_KBD("detect_keyboard_type_and_layout_sunos: %X %s", keyboardLayoutID, xkbfile);
}
#endif
if(keyboardLayoutID == 0)
{
keyboardLayoutID = detect_keyboaFRDP_layout_from_locale();
DEBUG_KBD("detect_keyboaFRDP_layout_from_locale: %X", keyboardLayoutID);
keyboardLayoutID = detect_keyboard_layout_from_locale();
DEBUG_KBD("detect_keyboard_layout_from_locale: %X", keyboardLayoutID);
}
if (keyboardLayoutID == 0)
@ -86,7 +86,7 @@ detect_keyboard(void *dpy, unsigned int keyboardLayoutID, char *xkbfile, size_t
*/
unsigned int
freerdp_kbd_init(void *dpy, unsigned int keyboaFRDP_layout_id)
freerdp_kbd_init(void *dpy, unsigned int keyboard_layout_id)
{
#ifdef WITH_XKBFILE
if (!init_xkb(dpy))
@ -94,10 +94,10 @@ freerdp_kbd_init(void *dpy, unsigned int keyboaFRDP_layout_id)
DEBUG_KBD("Error initializing xkb");
return 0;
}
if (!keyboaFRDP_layout_id)
if (!keyboard_layout_id)
{
keyboaFRDP_layout_id = detect_keyboaFRDP_layout_from_xkb(dpy);
DEBUG_KBD("detect_keyboaFRDP_layout_from_xkb: %X", keyboaFRDP_layout_id);
keyboard_layout_id = detect_keyboard_layout_from_xkb(dpy);
DEBUG_KBD("detect_keyboard_layout_from_xkb: %X", keyboard_layout_id);
}
init_keycodes_from_xkb(dpy, x_keycode_to_rdp_keycode);
#else
@ -105,11 +105,11 @@ freerdp_kbd_init(void *dpy, unsigned int keyboaFRDP_layout_id)
KeycodeToVkcode keycodeToVkcode;
int keycode;
keyboaFRDP_layout_id = detect_keyboard(dpy, keyboaFRDP_layout_id, xkbfile, sizeof(xkbfile));
keyboard_layout_id = detect_keyboard(dpy, keyboard_layout_id, xkbfile, sizeof(xkbfile));
DEBUG_KBD("Using keyboard layout 0x%X with xkb name %s and xkbfile %s",
keyboaFRDP_layout_id, get_layout_name(keyboaFRDP_layout_id), xkbfile);
keyboard_layout_id, get_layout_name(keyboard_layout_id), xkbfile);
load_keyboaFRDP_map(keycodeToVkcode, xkbfile);
load_keyboard_map(keycodeToVkcode, xkbfile);
for (keycode=0; keycode<256; keycode++)
{
@ -126,13 +126,13 @@ freerdp_kbd_init(void *dpy, unsigned int keyboaFRDP_layout_id)
}
#endif
return keyboaFRDP_layout_id;
return keyboard_layout_id;
}
rdpKeyboardLayout *
freerdp_kbd_get_layouts(int types)
{
return get_keyboaFRDP_layouts(types);
return get_keyboard_layouts(types);
}
uint8

View File

@ -422,7 +422,7 @@ static const localeAndKeyboardLayout defaultKeyboardLayouts[] =
};
unsigned int
detect_keyboaFRDP_layout_from_locale()
detect_keyboard_layout_from_locale()
{
int i;
int j;

View File

@ -321,6 +321,6 @@ Time zones, taken from Windows Server 2008
*/
unsigned int
detect_keyboaFRDP_layout_from_locale();
detect_keyboard_layout_from_locale();
#endif /* __LOCALES_H */

View File

@ -1076,7 +1076,7 @@ SunOSKeyboard SunOSKeyboards[] =
};
unsigned int
find_keyboaFRDP_layout_in_xorg_rules(char* layout, char* variant)
find_keyboard_layout_in_xorg_rules(char* layout, char* variant)
{
int i;
int j;
@ -1108,7 +1108,7 @@ find_keyboaFRDP_layout_in_xorg_rules(char* layout, char* variant)
#if defined(sun)
unsigned int
detect_keyboaFRDP_type_and_layout_sunos(char* xkbfile, int length)
detect_keyboard_type_and_layout_sunos(char* xkbfile, int length)
{
FILE* kbd;

View File

@ -23,11 +23,11 @@
#define __LAYOUTS_X_H
unsigned int
find_keyboaFRDP_layout_in_xorg_rules(char* layout, char* variant);
find_keyboard_layout_in_xorg_rules(char* layout, char* variant);
#if defined(sun)
unsigned int
detect_keyboaFRDP_type_and_layout_sunos(char* xkbfile, int length);
detect_keyboard_type_and_layout_sunos(char* xkbfile, int length);
#endif
#endif