aboutsummaryrefslogtreecommitdiffstats
path: root/android/charmap.h
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2010-07-07 15:57:00 -0700
committerVladimir Chtchetkine <vchtchetkine@google.com>2010-07-07 16:49:12 -0700
commit71bb14f826775867d16e7d382cfdc48e6ca46ccb (patch)
tree9e533673a8c4f7e8bc4b2b1f83589196e0957c0f /android/charmap.h
parenta21ac6912568a1d36a2919669f905bc58be21244 (diff)
downloadexternal_qemu-71bb14f826775867d16e7d382cfdc48e6ca46ccb.zip
external_qemu-71bb14f826775867d16e7d382cfdc48e6ca46ccb.tar.gz
external_qemu-71bb14f826775867d16e7d382cfdc48e6ca46ccb.tar.bz2
Move key event generation out of the UI realm into neutral space.
Abstracted keycode event array into keycode_array.[hc], Moved key to keycode translation into charmap.c Change-Id: I4de0c9853fa93d675895fc361e62ee36c1c0a652
Diffstat (limited to 'android/charmap.h')
-rw-r--r--android/charmap.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/android/charmap.h b/android/charmap.h
index 3d34224..08b059d 100644
--- a/android/charmap.h
+++ b/android/charmap.h
@@ -13,6 +13,7 @@
#define _android_charmap_h
#include "android/keycode.h"
+#include "android/keycode-array.h"
/* this defines a structure used to describe an Android keyboard charmap */
typedef struct AKeyEntry {
@@ -33,12 +34,6 @@ typedef struct AKeyCharmap {
char name[ AKEYCHARMAP_NAME_SIZE ];
} AKeyCharmap;
-/* Array of charmaps available in the current emulator session. */
-extern const AKeyCharmap** android_charmaps;
-
-/* Number of entries in android_charmaps array. */
-extern int android_charmap_count;
-
/* Extracts charmap name from .kcm file name.
* Charmap name, extracted by this routine is a name of the kcm file, trimmed
* of file name extension, and shrinked (if necessary) to fit into the name
@@ -72,4 +67,27 @@ int android_charmap_setup(const char* kcm_file_path);
/* Cleanups initialization performed in android_charmap_setup routine. */
void android_charmap_done(void);
+/* Gets charmap descriptor by its name.
+ * This routine finds and returns pointer to a descriptor in the array of
+ * charmaps that matches given name. If no such descriptor has been found, this
+ * routine returns NULL.
+ */
+const AKeyCharmap* android_get_charmap_by_name(const char* name);
+
+/* Gets charmap descriptor by its index in the array of charmaps.
+ * If index is greater than charmap array size, this routine returns NULL.
+ */
+const AKeyCharmap* android_get_charmap_by_index(unsigned int index);
+
+/* Maps given unicode key character into a keycode and adds mapped keycode into
+ * keycode array. This routine uses charmap passed as cmap parameter to do the
+ * translation, and 'down' parameter to generate appropriate ('down' or 'up')
+ * keycode.
+ */
+int
+android_charmap_reverse_map_unicode(const AKeyCharmap* cmap,
+ unsigned int unicode,
+ int down,
+ AKeycodeBuffer* keycodes);
+
#endif /* _android_charmap_h */