summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2012-09-21 14:44:17 +0300
committerDaniel Stone <daniel@fooishbar.org>2012-09-24 09:08:53 +1000
commitfcd202909bd558074885c8a35400e180646e115b (patch)
tree8e1f203c01fa0854f3c859668bda52a4f792dc4f /src
parentbf19408078824f96d2c265ad15e4ff12505166cc (diff)
Don't use xkbcommon-compat names in internal code
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/keymap-dump.c6
-rw-r--r--src/map.c26
-rw-r--r--src/map.h3
-rw-r--r--src/state.c58
-rw-r--r--src/xkbcomp/action.c6
-rw-r--r--src/xkbcomp/expr.c4
-rw-r--r--src/xkbcomp/expr.h2
-rw-r--r--src/xkbcomp/keymap.c4
-rw-r--r--src/xkbcomp/rules.c34
-rw-r--r--src/xkbcomp/symbols.c36
-rw-r--r--src/xkbcomp/vmod.c2
-rw-r--r--src/xkbcomp/xkbcomp.c24
12 files changed, 104 insertions, 101 deletions
diff --git a/src/keymap-dump.c b/src/keymap-dump.c
index b0ec338..42b125b 100644
--- a/src/keymap-dump.c
+++ b/src/keymap-dump.c
@@ -557,7 +557,7 @@ write_compat(struct xkb_keymap *keymap, struct buf *buf)
static bool
write_keysyms(struct xkb_keymap *keymap, struct buf *buf,
- struct xkb_key *key, xkb_group_index_t group)
+ struct xkb_key *key, xkb_layout_index_t group)
{
const xkb_keysym_t *syms;
int num_syms;
@@ -598,7 +598,7 @@ static bool
write_symbols(struct xkb_keymap *keymap, struct buf *buf)
{
struct xkb_key *key;
- xkb_group_index_t group, tmp;
+ xkb_layout_index_t group, tmp;
bool showActions;
if (keymap->symbols_section_name)
@@ -746,7 +746,7 @@ write_symbols(struct xkb_keymap *keymap, struct buf *buf)
}
XKB_EXPORT char *
-xkb_map_get_as_string(struct xkb_keymap *keymap)
+xkb_keymap_get_as_string(struct xkb_keymap *keymap)
{
bool ok;
struct buf buf = { NULL, 0, 0 };
diff --git a/src/map.c b/src/map.c
index 1ffcb0d..9c91749 100644
--- a/src/map.c
+++ b/src/map.c
@@ -131,7 +131,7 @@ xkb_keymap_mod_get_name(struct xkb_keymap *keymap, xkb_mod_index_t idx)
{
const char *name;
- if (idx >= xkb_map_num_mods(keymap))
+ if (idx >= xkb_keymap_num_mods(keymap))
return NULL;
/* First try to find a legacy modifier name. If that fails, try to
@@ -203,13 +203,13 @@ xkb_keymap_layout_get_index(struct xkb_keymap *keymap, const char *name)
xkb_layout_index_t i;
if (atom == XKB_ATOM_NONE)
- return XKB_GROUP_INVALID;
+ return XKB_LAYOUT_INVALID;
for (i = 0; i < num_groups; i++)
if (keymap->group_names[i] == atom)
return i;
- return XKB_GROUP_INVALID;
+ return XKB_LAYOUT_INVALID;
}
/**
@@ -263,7 +263,7 @@ 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 >= xkb_map_num_leds(keymap))
+ if (idx >= xkb_keymap_num_leds(keymap))
return NULL;
return xkb_atom_text(keymap->ctx, keymap->indicators[idx].name);
@@ -272,10 +272,10 @@ xkb_keymap_led_get_name(struct xkb_keymap *keymap, xkb_led_index_t idx)
/**
* Returns the index for a named group.
*/
-XKB_EXPORT xkb_group_index_t
+XKB_EXPORT xkb_layout_index_t
xkb_keymap_led_get_index(struct xkb_keymap *keymap, const char *name)
{
- xkb_led_index_t num_leds = xkb_map_num_leds(keymap);
+ xkb_led_index_t num_leds = xkb_keymap_num_leds(keymap);
xkb_atom_t atom = xkb_atom_lookup(keymap->ctx, name);
xkb_led_index_t i;
@@ -291,13 +291,13 @@ xkb_keymap_led_get_index(struct xkb_keymap *keymap, const char *name)
static struct xkb_kt_map_entry *
get_entry_for_key_state(struct xkb_state *state, const struct xkb_key *key,
- xkb_group_index_t group)
+ xkb_layout_index_t group)
{
struct xkb_key_type *type;
xkb_mod_mask_t active_mods;
unsigned int i;
- type = XkbKeyType(xkb_state_get_map(state), key, group);
+ type = XkbKeyType(xkb_state_get_keymap(state), key, group);
active_mods = xkb_state_serialize_mods(state, XKB_STATE_EFFECTIVE);
active_mods &= type->mods.mask;
@@ -404,7 +404,7 @@ XKB_EXPORT int
xkb_state_key_get_syms(struct xkb_state *state, xkb_keycode_t kc,
const xkb_keysym_t **syms_out)
{
- struct xkb_keymap *keymap = xkb_state_get_map(state);
+ struct xkb_keymap *keymap = xkb_state_get_keymap(state);
xkb_layout_index_t layout;
xkb_level_index_t level;
const struct xkb_key *key = XkbKey(keymap, kc);
@@ -444,10 +444,10 @@ static xkb_mod_mask_t
key_get_consumed(struct xkb_state *state, const struct xkb_key *key)
{
struct xkb_kt_map_entry *entry;
- xkb_group_index_t group;
+ xkb_layout_index_t group;
group = xkb_state_key_get_layout(state, key->keycode);
- if (group == XKB_GROUP_INVALID)
+ if (group == XKB_LAYOUT_INVALID)
return 0;
entry = get_entry_for_key_state(state, key, group);
@@ -473,7 +473,7 @@ XKB_EXPORT int
xkb_state_mod_index_is_consumed(struct xkb_state *state, xkb_keycode_t kc,
xkb_mod_index_t idx)
{
- const struct xkb_key *key = XkbKey(xkb_state_get_map(state), kc);
+ const struct xkb_key *key = XkbKey(xkb_state_get_keymap(state), kc);
if (!key)
return 0;
@@ -492,7 +492,7 @@ XKB_EXPORT xkb_mod_mask_t
xkb_state_mod_mask_remove_consumed(struct xkb_state *state, xkb_keycode_t kc,
xkb_mod_mask_t mask)
{
- const struct xkb_key *key = XkbKey(xkb_state_get_map(state), kc);
+ const struct xkb_key *key = XkbKey(xkb_state_get_keymap(state), kc);
if (!key)
return 0;
diff --git a/src/map.h b/src/map.h
index 7c2be1b..6360165 100644
--- a/src/map.h
+++ b/src/map.h
@@ -81,7 +81,10 @@
#ifndef MAP_H
#define MAP_H
+ /* Don't use compat names in internal code. */
+#define _XKBCOMMON_COMPAT_H
#include "xkbcommon/xkbcommon.h"
+
#include "utils.h"
#include "context.h"
diff --git a/src/state.c b/src/state.c
index 8529f4e..69993b0 100644
--- a/src/state.c
+++ b/src/state.c
@@ -73,10 +73,10 @@ struct xkb_filter {
};
struct xkb_state {
- xkb_group_index_t base_group; /**< depressed */
- xkb_group_index_t latched_group;
- xkb_group_index_t locked_group;
- xkb_group_index_t group; /**< effective */
+ xkb_layout_index_t base_group; /**< depressed */
+ xkb_layout_index_t latched_group;
+ xkb_layout_index_t locked_group;
+ xkb_layout_index_t group; /**< effective */
xkb_mod_mask_t base_mods; /**< depressed */
xkb_mod_mask_t latched_mods;
@@ -459,7 +459,7 @@ xkb_state_new(struct xkb_keymap *keymap)
return NULL;
ret->refcnt = 1;
- ret->keymap = xkb_map_ref(keymap);
+ ret->keymap = xkb_keymap_ref(keymap);
return ret;
}
@@ -477,13 +477,13 @@ xkb_state_unref(struct xkb_state *state)
if (--state->refcnt > 0)
return;
- xkb_map_unref(state->keymap);
+ xkb_keymap_unref(state->keymap);
darray_free(state->filters);
free(state);
}
XKB_EXPORT struct xkb_keymap *
-xkb_state_get_map(struct xkb_state *state)
+xkb_state_get_keymap(struct xkb_state *state)
{
return state->keymap;
}
@@ -598,9 +598,9 @@ xkb_state_update_mask(struct xkb_state *state,
xkb_mod_mask_t base_mods,
xkb_mod_mask_t latched_mods,
xkb_mod_mask_t locked_mods,
- xkb_group_index_t base_group,
- xkb_group_index_t latched_group,
- xkb_group_index_t locked_group)
+ xkb_layout_index_t base_group,
+ xkb_layout_index_t latched_group,
+ xkb_layout_index_t locked_group)
{
xkb_mod_index_t num_mods;
xkb_mod_index_t idx;
@@ -608,7 +608,7 @@ xkb_state_update_mask(struct xkb_state *state,
state->base_mods = 0;
state->latched_mods = 0;
state->locked_mods = 0;
- num_mods = xkb_map_num_mods(state->keymap);
+ num_mods = xkb_keymap_num_mods(state->keymap);
for (idx = 0; idx < num_mods; idx++) {
xkb_mod_mask_t mod = (1 << idx);
@@ -654,11 +654,11 @@ xkb_state_serialize_mods(struct xkb_state *state,
* Serialises the requested group state, with all the same disclaimers as
* in xkb_state_update_mask.
*/
-XKB_EXPORT xkb_group_index_t
-xkb_state_serialize_group(struct xkb_state *state,
- enum xkb_state_component type)
+XKB_EXPORT xkb_layout_index_t
+xkb_state_serialize_layout(struct xkb_state *state,
+ enum xkb_state_component type)
{
- xkb_group_index_t ret = 0;
+ xkb_layout_index_t ret = 0;
if (type == XKB_STATE_EFFECTIVE)
return state->group;
@@ -684,7 +684,7 @@ xkb_state_mod_index_is_active(struct xkb_state *state,
{
int ret = 0;
- if (idx >= xkb_map_num_mods(state->keymap))
+ if (idx >= xkb_keymap_num_mods(state->keymap))
return -1;
if (type & XKB_STATE_DEPRESSED)
@@ -732,7 +732,7 @@ xkb_state_mod_indices_are_active(struct xkb_state *state,
xkb_mod_index_t idx = 0;
uint32_t wanted = 0;
int ret = 0;
- xkb_mod_index_t num_mods = xkb_map_num_mods(state->keymap);
+ xkb_mod_index_t num_mods = xkb_keymap_num_mods(state->keymap);
va_start(ap, match);
while (1) {
@@ -761,7 +761,7 @@ XKB_EXPORT int
xkb_state_mod_name_is_active(struct xkb_state *state, const char *name,
enum xkb_state_component type)
{
- xkb_mod_index_t idx = xkb_map_mod_get_index(state->keymap, name);
+ xkb_mod_index_t idx = xkb_keymap_mod_get_index(state->keymap, name);
if (idx == XKB_MOD_INVALID)
return -1;
@@ -790,7 +790,7 @@ xkb_state_mod_names_are_active(struct xkb_state *state,
str = va_arg(ap, const char *);
if (str == NULL)
break;
- idx = xkb_map_mod_get_index(state->keymap, str);
+ idx = xkb_keymap_mod_get_index(state->keymap, str);
if (idx == XKB_MOD_INVALID) {
ret = -1;
break;
@@ -810,13 +810,13 @@ xkb_state_mod_names_are_active(struct xkb_state *state,
* not, or -1 if the group is invalid.
*/
XKB_EXPORT int
-xkb_state_group_index_is_active(struct xkb_state *state,
- xkb_group_index_t idx,
+xkb_state_layout_index_is_active(struct xkb_state *state,
+ xkb_layout_index_t idx,
enum xkb_state_component type)
{
int ret = 0;
- if (idx >= xkb_map_num_groups(state->keymap))
+ if (idx >= xkb_keymap_num_layouts(state->keymap))
return -1;
if (type & XKB_STATE_DEPRESSED)
@@ -834,15 +834,15 @@ xkb_state_group_index_is_active(struct xkb_state *state,
* not, or -1 if the modifier is invalid.
*/
XKB_EXPORT int
-xkb_state_group_name_is_active(struct xkb_state *state, const char *name,
- enum xkb_state_component type)
+xkb_state_layout_name_is_active(struct xkb_state *state, const char *name,
+ enum xkb_state_component type)
{
- xkb_group_index_t idx = xkb_map_group_get_index(state->keymap, name);
+ xkb_layout_index_t idx = xkb_keymap_layout_get_index(state->keymap, name);
- if (idx == XKB_GROUP_INVALID)
+ if (idx == XKB_LAYOUT_INVALID)
return -1;
- return xkb_state_group_index_is_active(state, idx, type);
+ return xkb_state_layout_index_is_active(state, idx, type);
}
/**
@@ -851,7 +851,7 @@ xkb_state_group_name_is_active(struct xkb_state *state, const char *name,
XKB_EXPORT int
xkb_state_led_index_is_active(struct xkb_state *state, xkb_led_index_t idx)
{
- if (idx >= xkb_map_num_leds(state->keymap))
+ if (idx >= xkb_keymap_num_leds(state->keymap))
return -1;
return !!(state->leds & (1 << idx));
@@ -863,7 +863,7 @@ xkb_state_led_index_is_active(struct xkb_state *state, xkb_led_index_t idx)
XKB_EXPORT int
xkb_state_led_name_is_active(struct xkb_state *state, const char *name)
{
- xkb_led_index_t idx = xkb_map_led_get_index(state->keymap, name);
+ xkb_led_index_t idx = xkb_keymap_led_get_index(state->keymap, name);
if (idx == XKB_LED_INVALID)
return -1;
diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c
index 81a5eaa..47d273c 100644
--- a/src/xkbcomp/action.c
+++ b/src/xkbcomp/action.c
@@ -364,7 +364,7 @@ HandleLockMods(struct xkb_keymap *keymap, union xkb_action *action,
static bool
CheckGroupField(struct xkb_keymap *keymap, unsigned action,
const ExprDef *value, enum xkb_action_flags *flags_inout,
- xkb_group_index_t *grp_rtrn)
+ xkb_layout_index_t *grp_rtrn)
{
const ExprDef *spec;
@@ -396,7 +396,7 @@ HandleSetLatchGroup(struct xkb_keymap *keymap, union xkb_action *action,
{
struct xkb_group_action *act = &action->group;
enum xkb_action_flags rtrn, t1;
- xkb_group_index_t t2;
+ xkb_layout_index_t t2;
if (array_ndx != NULL) {
switch (field) {
@@ -443,7 +443,7 @@ HandleLockGroup(struct xkb_keymap *keymap, union xkb_action *action,
{
struct xkb_group_action *act = &action->group;
enum xkb_action_flags t1;
- xkb_group_index_t t2;
+ xkb_layout_index_t t2;
if ((array_ndx != NULL) && (field == ACTION_FIELD_GROUP))
return ReportActionNotArray(keymap, action->type, field);
diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index e30d7e2..a7c91b8 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -386,7 +386,7 @@ ExprResolveInteger(struct xkb_context *ctx, const ExprDef *expr,
bool
ExprResolveGroup(struct xkb_context *ctx, const ExprDef *expr,
- xkb_group_index_t *group_rtrn)
+ xkb_layout_index_t *group_rtrn)
{
bool ok;
int result;
@@ -402,7 +402,7 @@ ExprResolveGroup(struct xkb_context *ctx, const ExprDef *expr,
return false;
}
- *group_rtrn = (xkb_group_index_t) result;
+ *group_rtrn = (xkb_layout_index_t) result;
return true;
}
diff --git a/src/xkbcomp/expr.h b/src/xkbcomp/expr.h
index 450b6c8..21d9c5d 100644
--- a/src/xkbcomp/expr.h
+++ b/src/xkbcomp/expr.h
@@ -70,7 +70,7 @@ ExprResolveLevel(struct xkb_context *ctx, const ExprDef *expr,
bool
ExprResolveGroup(struct xkb_context *ctx, const ExprDef *expr,
- xkb_group_index_t *group_rtrn);
+ xkb_layout_index_t *group_rtrn);
bool
ExprResolveButton(struct xkb_context *ctx, const ExprDef *expr,
diff --git a/src/xkbcomp/keymap.c b/src/xkbcomp/keymap.c
index a10d834..6ca91d1 100644
--- a/src/xkbcomp/keymap.c
+++ b/src/xkbcomp/keymap.c
@@ -69,7 +69,7 @@ UpdateActionMods(struct xkb_keymap *keymap, union xkb_action *act,
*/
static struct xkb_sym_interpret *
FindInterpForKey(struct xkb_keymap *keymap, struct xkb_key *key,
- xkb_group_index_t group, xkb_level_index_t level)
+ xkb_layout_index_t group, xkb_level_index_t level)
{
struct xkb_sym_interpret *interp;
const xkb_keysym_t *syms;
@@ -131,7 +131,7 @@ static bool
ApplyInterpsToKey(struct xkb_keymap *keymap, struct xkb_key *key)
{
xkb_mod_mask_t vmodmask = 0;
- xkb_group_index_t group;
+ xkb_layout_index_t group;
xkb_level_index_t width, level;
/* If we've been told not to bind interps to this key, then don't. */
diff --git a/src/xkbcomp/rules.c b/src/xkbcomp/rules.c
index badbbf2..0fe2b9b 100644
--- a/src/xkbcomp/rules.c
+++ b/src/xkbcomp/rules.c
@@ -400,7 +400,7 @@ struct mapping {
int mlvo_at_pos[_MLVO_NUM_ENTRIES];
unsigned int num_mlvo;
unsigned int defined_mlvo_mask;
- xkb_group_index_t layout_idx, variant_idx;
+ xkb_layout_index_t layout_idx, variant_idx;
int kccgst_at_pos[_KCCGST_NUM_ENTRIES];
unsigned int num_kccgst;
unsigned int defined_kccgst_mask;
@@ -544,7 +544,7 @@ matcher_mapping_start_new(struct matcher *m)
m->mapping.mlvo_at_pos[i] = -1;
for (i = 0; i < _KCCGST_NUM_ENTRIES; i++)
m->mapping.kccgst_at_pos[i] = -1;
- m->mapping.layout_idx = m->mapping.variant_idx = XKB_GROUP_INVALID;
+ m->mapping.layout_idx = m->mapping.variant_idx = XKB_LAYOUT_INVALID;
m->mapping.num_mlvo = m->mapping.num_kccgst = 0;
m->mapping.defined_mlvo_mask = 0;
m->mapping.defined_kccgst_mask = 0;
@@ -552,7 +552,7 @@ matcher_mapping_start_new(struct matcher *m)
}
static int
-extract_group_index(const char *s, size_t max_len, xkb_group_index_t *out)
+extract_layout_index(const char *s, size_t max_len, xkb_layout_index_t *out)
{
/* This function is pretty stupid, but works for now. */
if (max_len < 3)
@@ -571,7 +571,7 @@ matcher_mapping_set_mlvo(struct matcher *m, struct sval ident)
{
enum rules_mlvo mlvo;
struct sval mlvo_sval;
- xkb_group_index_t idx;
+ xkb_layout_index_t idx;
int consumed;
for (mlvo = 0; mlvo < _MLVO_NUM_ENTRIES; mlvo++) {
@@ -602,7 +602,7 @@ matcher_mapping_set_mlvo(struct matcher *m, struct sval ident)
/* If there are leftovers still, it must be an index. */
if (mlvo_sval.len < ident.len) {
- consumed = extract_group_index(ident.start + mlvo_sval.len,
+ consumed = extract_layout_index(ident.start + mlvo_sval.len,
ident.len - mlvo_sval.len, &idx);
if ((int) (ident.len - mlvo_sval.len) != consumed) {
matcher_error(m,
@@ -694,7 +694,7 @@ matcher_mapping_verify(struct matcher *m)
*/
if (m->mapping.defined_mlvo_mask & (1 << MLVO_LAYOUT)) {
- if (m->mapping.layout_idx == XKB_GROUP_INVALID) {
+ if (m->mapping.layout_idx == XKB_LAYOUT_INVALID) {
if (darray_size(m->rmlvo.layouts) > 1)
goto skip;
}
@@ -706,7 +706,7 @@ matcher_mapping_verify(struct matcher *m)
}
if (m->mapping.defined_mlvo_mask & (1 << MLVO_VARIANT)) {
- if (m->mapping.variant_idx == XKB_GROUP_INVALID) {
+ if (m->mapping.variant_idx == XKB_LAYOUT_INVALID) {
if (darray_size(m->rmlvo.variants) > 1)
goto skip;
}
@@ -831,7 +831,7 @@ append_expanded_kccgst_value(struct matcher *m, darray_char *to,
unsigned int i;
size_t original_size = darray_size(*to);
const char *s = value.start;
- xkb_group_index_t idx;
+ xkb_layout_index_t idx;
int consumed;
enum rules_mlvo mlv;
struct sval expanded;
@@ -890,12 +890,12 @@ append_expanded_kccgst_value(struct matcher *m, darray_char *to,
goto error;
}
- consumed = extract_group_index(s + i, value.len - i, &idx);
+ consumed = extract_layout_index(s + i, value.len - i, &idx);
if (consumed == -1) goto error;
i += consumed;
}
else {
- idx = XKB_GROUP_INVALID;
+ idx = XKB_LAYOUT_INVALID;
}
}
@@ -909,20 +909,20 @@ append_expanded_kccgst_value(struct matcher *m, darray_char *to,
expanded.len = 0;
if (mlv == MLVO_LAYOUT) {
- if (idx != XKB_GROUP_INVALID &&
+ if (idx != XKB_LAYOUT_INVALID &&
idx < darray_size(m->rmlvo.layouts) &&
darray_size(m->rmlvo.layouts) > 1)
expanded = darray_item(m->rmlvo.layouts, idx);
- else if (idx == XKB_GROUP_INVALID &&
+ else if (idx == XKB_LAYOUT_INVALID &&
darray_size(m->rmlvo.layouts) == 1)
expanded = darray_item(m->rmlvo.layouts, 0);
}
else if (mlv == MLVO_VARIANT) {
- if (idx != XKB_GROUP_INVALID &&
+ if (idx != XKB_LAYOUT_INVALID &&
idx < darray_size(m->rmlvo.variants) &&
darray_size(m->rmlvo.variants) > 1)
expanded = darray_item(m->rmlvo.variants, idx);
- else if (idx == XKB_GROUP_INVALID &&
+ else if (idx == XKB_LAYOUT_INVALID &&
darray_size(m->rmlvo.variants) == 1)
expanded = darray_item(m->rmlvo.variants, 0);
}
@@ -970,7 +970,7 @@ matcher_rule_apply_if_matches(struct matcher *m)
struct sval value, *option;
enum mlvo_match_type match_type;
bool matched = false;
- xkb_group_index_t idx;
+ xkb_layout_index_t idx;
for (i = 0; i < m->mapping.num_mlvo; i++) {
mlvo = m->mapping.mlvo_at_pos[i];
@@ -982,14 +982,14 @@ matcher_rule_apply_if_matches(struct matcher *m)
}
else if (mlvo == MLVO_LAYOUT) {
idx = m->mapping.layout_idx;
- idx = (idx == XKB_GROUP_INVALID ? 0 : idx);
+ idx = (idx == XKB_LAYOUT_INVALID ? 0 : idx);
matched = match_value(m, value,
darray_item(m->rmlvo.layouts, idx),
match_type);
}
else if (mlvo == MLVO_VARIANT) {
idx = m->mapping.layout_idx;
- idx = (idx == XKB_GROUP_INVALID ? 0 : idx);
+ idx = (idx == XKB_LAYOUT_INVALID ? 0 : idx);
matched = match_value(m, value,
darray_item(m->rmlvo.variants, idx),
match_type);
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index 278732c..4233a76 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -108,7 +108,7 @@ typedef struct _KeyInfo {
xkb_atom_t dfltType;
enum xkb_range_exceed_type out_of_range_group_action;
- xkb_group_index_t out_of_range_group_number;
+ xkb_layout_index_t out_of_range_group_number;
} KeyInfo;
static void
@@ -139,7 +139,7 @@ InitKeyInfo(KeyInfo *keyi, unsigned file_id)
static void
ClearKeyInfo(KeyInfo *keyi)
{
- xkb_group_index_t i;
+ xkb_layout_index_t i;
for (i = 0; i < XKB_NUM_GROUPS; i++)
ClearGroupInfo(&keyi->groups[i]);
}
@@ -161,7 +161,7 @@ typedef struct _SymbolsInfo {
int errorCount;
unsigned file_id;
enum merge_mode merge;
- xkb_group_index_t explicit_group;
+ xkb_layout_index_t explicit_group;
darray(KeyInfo) keys;
KeyInfo dflt;
VModInfo vmods;
@@ -198,7 +198,7 @@ ClearSymbolsInfo(SymbolsInfo * info)
static bool
MergeGroups(SymbolsInfo *info, GroupInfo *into, GroupInfo *from, bool clobber,
- bool report, xkb_group_index_t group, unsigned long key_name)
+ bool report, xkb_layout_index_t group, unsigned long key_name)
{
xkb_level_index_t i, numLevels;
enum { INTO = (1 << 0), FROM = (1 << 1) } using;
@@ -393,7 +393,7 @@ UseNewKeyField(enum key_field field, enum key_field old, enum key_field new,
static bool
MergeKeys(SymbolsInfo *info, KeyInfo *into, KeyInfo *from)
{
- xkb_group_index_t i;
+ xkb_layout_index_t i;
enum key_field collide = 0;
bool clobber, report;
int verbosity = xkb_get_log_verbosity(info->keymap->ctx);
@@ -626,12 +626,12 @@ HandleIncludeSymbols(SymbolsInfo *info, IncludeStmt *stmt)
static bool
GetGroupIndex(SymbolsInfo *info, KeyInfo *keyi, ExprDef *arrayNdx,
- unsigned what, xkb_group_index_t *ndx_rtrn)
+ unsigned what, xkb_layout_index_t *ndx_rtrn)
{
const char *name = (what == SYMBOLS ? "symbols" : "actions");
if (arrayNdx == NULL) {
- xkb_group_index_t i;
+ xkb_layout_index_t i;
enum group_field field = (what == SYMBOLS ?
GROUP_FIELD_SYMS : GROUP_FIELD_ACTS);
@@ -689,7 +689,7 @@ static bool
AddSymbolsToKey(SymbolsInfo *info, KeyInfo *keyi, ExprDef *arrayNdx,
ExprDef *value)
{
- xkb_group_index_t ndx;
+ xkb_layout_index_t ndx;
GroupInfo *groupi;
unsigned int nSyms;
xkb_level_index_t nLevels;
@@ -779,7 +779,7 @@ AddActionsToKey(SymbolsInfo *info, KeyInfo *keyi, ExprDef *arrayNdx,
ExprDef *value)
{
unsigned int i;
- xkb_group_index_t ndx;
+ xkb_layout_index_t ndx;
GroupInfo *groupi;
unsigned int nActs;
ExprDef *act;
@@ -854,7 +854,7 @@ SetSymbolsField(SymbolsInfo *info, KeyInfo *keyi, const char *field,
struct xkb_context *ctx = info->keymap->ctx;
if (istreq(field, "type")) {
- xkb_group_index_t ndx;
+ xkb_layout_index_t ndx;
xkb_atom_t val;
if (!ExprResolveString(ctx, value, &val))
@@ -980,7 +980,7 @@ SetSymbolsField(SymbolsInfo *info, KeyInfo *keyi, const char *field,
}
else if (istreq(field, "groupsredirect") ||
istreq(field, "redirectgroups")) {
- xkb_group_index_t grp;
+ xkb_layout_index_t grp;
if (!ExprResolveGroup(ctx, value, &grp)) {
log_err(info->keymap->ctx,
@@ -1008,7 +1008,7 @@ SetSymbolsField(SymbolsInfo *info, KeyInfo *keyi, const char *field,
static int
SetGroupName(SymbolsInfo *info, ExprDef *arrayNdx, ExprDef *value)
{
- xkb_group_index_t grp;
+ xkb_layout_index_t grp;
xkb_atom_t name;
if (!arrayNdx) {
@@ -1121,7 +1121,7 @@ HandleSymbolsBody(SymbolsInfo *info, VarDef *def, KeyInfo *keyi)
static bool
SetExplicitGroup(SymbolsInfo *info, KeyInfo *keyi)
{
- xkb_group_index_t i;
+ xkb_layout_index_t i;
if (info->explicit_group == 0)
return true;
@@ -1149,7 +1149,7 @@ static int
HandleSymbolsDef(SymbolsInfo *info, SymbolsDef *stmt)
{
KeyInfo keyi;
- xkb_group_index_t i;
+ xkb_layout_index_t i;
keyi = info->dflt;
for (i = 0; i < XKB_NUM_GROUPS; i++) {
@@ -1282,7 +1282,7 @@ static struct xkb_key *
FindKeyForSymbol(struct xkb_keymap *keymap, xkb_keysym_t sym)
{
struct xkb_key *key, *ret = NULL;
- xkb_group_index_t group, min_group = UINT32_MAX;
+ xkb_layout_index_t group, min_group = UINT32_MAX;
xkb_level_index_t level, min_level = UINT16_MAX;
xkb_foreach_key(key, keymap) {
@@ -1403,7 +1403,7 @@ FindAutomaticType(struct xkb_context *ctx, xkb_level_index_t width,
static void
PrepareKeyDef(KeyInfo *keyi)
{
- xkb_group_index_t i, lastGroup;
+ xkb_layout_index_t i, lastGroup;
const GroupInfo *group0;
bool identical;
@@ -1474,7 +1474,7 @@ CopySymbolsDef(SymbolsInfo *info, KeyInfo *keyi)
{
struct xkb_keymap *keymap = info->keymap;
struct xkb_key *key;
- xkb_group_index_t i;
+ xkb_layout_index_t i;
bool haveActions;
unsigned int sizeSyms;
unsigned int symIndex;
@@ -1676,7 +1676,7 @@ CopySymbolsToKeymap(struct xkb_keymap *keymap, SymbolsInfo *info)
{
KeyInfo *keyi;
ModMapEntry *mm;
- xkb_group_index_t i;
+ xkb_layout_index_t i;
struct xkb_key *key;
keymap->symbols_section_name = strdup_safe(info->name);
diff --git a/src/xkbcomp/vmod.c b/src/xkbcomp/vmod.c
index b09e3ef..17a16cf 100644
--- a/src/xkbcomp/vmod.c
+++ b/src/xkbcomp/vmod.c
@@ -32,7 +32,7 @@
void
InitVModInfo(VModInfo *info, struct xkb_keymap *keymap)
{
- xkb_group_index_t i;
+ xkb_layout_index_t i;
memset(info, 0, sizeof(*info));
for (i = 0; i < XKB_NUM_VIRTUAL_MODS; i++)
diff --git a/src/xkbcomp/xkbcomp.c b/src/xkbcomp/xkbcomp.c
index fd997d5..7da20d6 100644
--- a/src/xkbcomp/xkbcomp.c
+++ b/src/xkbcomp/xkbcomp.c
@@ -53,14 +53,14 @@ compile_keymap_file(struct xkb_context *ctx, XkbFile *file)
return keymap;
err:
- xkb_map_unref(keymap);
+ xkb_keymap_unref(keymap);
return NULL;
}
XKB_EXPORT struct xkb_keymap *
-xkb_map_new_from_names(struct xkb_context *ctx,
- const struct xkb_rule_names *rmlvo_in,
- enum xkb_map_compile_flags flags)
+xkb_keymap_new_from_names(struct xkb_context *ctx,
+ const struct xkb_rule_names *rmlvo_in,
+ enum xkb_keymap_compile_flags flags)
{
bool ok;
struct xkb_component_names kccgst;
@@ -117,10 +117,10 @@ xkb_map_new_from_names(struct xkb_context *ctx,
}
XKB_EXPORT struct xkb_keymap *
-xkb_map_new_from_string(struct xkb_context *ctx,
- const char *string,
- enum xkb_keymap_format format,
- enum xkb_map_compile_flags flags)
+xkb_keymap_new_from_string(struct xkb_context *ctx,
+ const char *string,
+ enum xkb_keymap_format format,
+ enum xkb_keymap_compile_flags flags)
{
bool ok;
XkbFile *file;
@@ -148,10 +148,10 @@ xkb_map_new_from_string(struct xkb_context *ctx,
}
XKB_EXPORT struct xkb_keymap *
-xkb_map_new_from_file(struct xkb_context *ctx,
- FILE *file,
- enum xkb_keymap_format format,
- enum xkb_map_compile_flags flags)
+xkb_keymap_new_from_file(struct xkb_context *ctx,
+ FILE *file,
+ enum xkb_keymap_format format,
+ enum xkb_keymap_compile_flags flags)
{
bool ok;
XkbFile *xkb_file;