diff options
author | Ran Benita <ran234@gmail.com> | 2013-02-17 22:18:57 +0200 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2013-03-18 22:20:02 +0000 |
commit | 8cee7490003381b7e1399e171a8c860edb3d634c (patch) | |
tree | 5cb829b303322446fa72bf250ba037ab9200b75f /src/keymap.c | |
parent | 10c351f5163ff8ce3be232207bf9c0f68fbbb47d (diff) | |
download | libxkbcommon-8cee7490003381b7e1399e171a8c860edb3d634c.tar.gz libxkbcommon-8cee7490003381b7e1399e171a8c860edb3d634c.tar.bz2 libxkbcommon-8cee7490003381b7e1399e171a8c860edb3d634c.zip |
Change 'indicator' to 'led' everywhere possible
The code currently uses the two names interchangeably.
Settle on 'led', because it is shorter, more recognizable, and what we
use in our API (though of course the parser still uses 'indicator').
In camel case we make it 'Led'.
We change 'xkb_indicator_map' to just 'xkb_led' and the variables of
this type are 'led'. This mimics 'xkb_key' and 'key'.
IndicatorNameInfo and LEDInfo are changed to 'LedNameInfo' and
'LedInfo', and the variables are 'ledi' (like 'keyi' etc.). This is
instead of 'ii' and 'im'.
This might make a few places a bit confusing, but less than before I
think. It's also shorter.
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/keymap.c')
-rw-r--r-- | src/keymap.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/keymap.c b/src/keymap.c index 87694cf..e5bc2e6 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -110,7 +110,7 @@ xkb_keymap_unref(struct xkb_keymap *keymap) darray_free(keymap->key_aliases); free(keymap->group_names); darray_free(keymap->mods); - darray_free(keymap->indicators); + darray_free(keymap->leds); free(keymap->keycodes_section_name); free(keymap->symbols_section_name); free(keymap->types_section_name); @@ -242,7 +242,7 @@ xkb_keymap_num_levels_for_key(struct xkb_keymap *keymap, xkb_keycode_t kc, XKB_EXPORT xkb_led_index_t xkb_keymap_num_leds(struct xkb_keymap *keymap) { - return darray_size(keymap->indicators); + return darray_size(keymap->leds); } /** @@ -251,11 +251,10 @@ xkb_keymap_num_leds(struct xkb_keymap *keymap) XKB_EXPORT const char * xkb_keymap_led_get_name(struct xkb_keymap *keymap, xkb_led_index_t idx) { - if (idx >= darray_size(keymap->indicators)) + if (idx >= darray_size(keymap->leds)) return NULL; - return xkb_atom_text(keymap->ctx, - darray_item(keymap->indicators, idx).name); + return xkb_atom_text(keymap->ctx, darray_item(keymap->leds, idx).name); } /** @@ -266,12 +265,12 @@ xkb_keymap_led_get_index(struct xkb_keymap *keymap, const char *name) { xkb_atom_t atom = xkb_atom_lookup(keymap->ctx, name); xkb_led_index_t i; - const struct xkb_indicator_map *led; + const struct xkb_led *led; if (atom == XKB_ATOM_NONE) return XKB_LED_INVALID; - darray_enumerate(i, led, keymap->indicators) + darray_enumerate(i, led, keymap->leds) if (led->name == atom) return i; |