diff options
author | Vladimir Chtchetkine <vchtchetkine@google.com> | 2010-07-22 11:23:19 -0700 |
---|---|---|
committer | Vladimir Chtchetkine <vchtchetkine@google.com> | 2010-07-22 11:23:19 -0700 |
commit | 43552dc4fa64aad0c9fdb8f4c92ae7ac79406596 (patch) | |
tree | b1263d1a7fc5cf44f4f05334d73927dd91148609 /android/charmap.c | |
parent | 2fa5173bd1ce7341c50adac676a317945f0969c7 (diff) | |
download | external_qemu-43552dc4fa64aad0c9fdb8f4c92ae7ac79406596.zip external_qemu-43552dc4fa64aad0c9fdb8f4c92ae7ac79406596.tar.gz external_qemu-43552dc4fa64aad0c9fdb8f4c92ae7ac79406596.tar.bz2 |
Remove UI dependency from goldfish_event_device.c
Change-Id: Iea5edfbae0caff45161c814d631d35d2e6d61d1c
Diffstat (limited to 'android/charmap.c')
-rw-r--r-- | android/charmap.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/android/charmap.c b/android/charmap.c index af4163a..553ad67 100644 --- a/android/charmap.c +++ b/android/charmap.c @@ -265,8 +265,8 @@ static const AKeyCharmap _qwerty2_charmap = /* Custom character map created with -charmap option. */ static AKeyCharmap android_custom_charmap = { 0 }; -const AKeyCharmap** android_charmaps = 0; -int android_charmap_count = 0; +static const AKeyCharmap** android_charmaps = 0; +static int android_charmap_count = 0; /* Checks if a character represents an end of the line. * Returns a non-zero value if ch is an EOL character. Returns @@ -693,6 +693,13 @@ parse_kcm_file(const char* kcm_file_path, AKeyCharmap* char_map) { int android_charmap_setup(const char* kcm_file_path) { + // android_charmap_count being non-zero is used here as a flag, + // indicating that charmap has been initialized for the running + // executable. + if (android_charmap_count != 0) { + return 0; + } + if (NULL != kcm_file_path) { if (!parse_kcm_file(kcm_file_path, &android_custom_charmap)) { // Here we have two default charmaps and the custom one. @@ -820,3 +827,15 @@ android_charmap_reverse_map_unicode(const AKeyCharmap* cmap, /* no match */ return 0; } + +const AKeyCharmap* +android_get_default_charmap(void) +{ + return android_get_charmap_by_index(0); +} + +const char* +android_get_default_charmap_name(void) +{ + return android_get_default_charmap()->name; +} |