state: add xkb_state_key_get_{utf8,utf32}() API functions
authorRan Benita <ran234@gmail.com>
Fri, 21 Mar 2014 21:00:17 +0000 (23:00 +0200)
committerRan Benita <ran234@gmail.com>
Sat, 22 Mar 2014 15:17:16 +0000 (17:17 +0200)
commitb973d71e82e9ec042d604226ccf0ba641773f38f
treebf0e11bb6498726efcffd2956cf351e5558f8c04
parent2bbaf7c7d1f2fecbdc3b2ed6cf34c63d117824bd
state: add xkb_state_key_get_{utf8,utf32}() API functions

These functions generally have the same effect as
xkb_state_key_get_syms() + xkb_keysym_to_utf{8,32}().

So why add them?

- They provide a slightly nicer interface, especially if the string is
  the only interest.

- It makes the handling of multiple-keysyms-to-utf8 transparent. For the
  designated use-case of multiple-keysyms (unicode combining
  characters), this is a must. We also validate the UTF-8, which the
  user might not otherwise do.

- We will need to apply some transformation on the resulting string
  which depend on the xkb_state. This is not possible with the
  xkb_keysym_* functions.

With these functions, the existing xkb_keysym_to_utf{8,32}() are not
expected to be used by a typical user; they are "raw" functions.

Signed-off-by: Ran Benita <ran234@gmail.com>
src/state.c
test/common.c
test/state.c
xkbcommon/xkbcommon.h