Add format argument to xkb_keymap_get_as_string
authorRan Benita <ran234@gmail.com>
Sun, 23 Sep 2012 15:52:51 +0000 (17:52 +0200)
committerDaniel Stone <daniel@fooishbar.org>
Sun, 23 Sep 2012 23:13:32 +0000 (09:13 +1000)
commit9a18b87251d1111987e98926a9aba9e72afc0259
tree459f2e0b34c7ae96d030c395e1bfcb5aa93bf54d
parent5d31b9e3e706df2256295d5c92b74935d1e9fbcd
Add format argument to xkb_keymap_get_as_string

This function really needs a format argument, for symmetry with the
keymap creation functions. If we add new formats, we will almost
certainly want to add support for serializing it into a string. It would
also allow to convert from one format to another, etc.

The in the common case, the user would just want to use the format she
used to create the keymap; for that we add a special
XKB_KEYMAP_USE_ORIGINAL_FORMAT value, which will do that (it is defined
to -1 outside of the enum because I have a feeling we might want to use
0 for something else). To support this we need to keep the format inside
the keymap. While we're at it we also initialize keymap flags properly.

This changes the API, but the old xkb_map_get_as_string name works as
expected so this is the best time to do this.

Signed-off-by: Ran Benita <ran234@gmail.com>
src/compat.c
src/keymap-dump.c
src/keymap.c
src/keymap.h
src/xkbcomp/xkbcomp.c
test/print-compiled-keymap.c
test/stringcomp.c
xkbcommon/xkbcommon-compat.h
xkbcommon/xkbcommon.h