From: Daniel Stone Date: Tue, 11 Sep 2012 11:32:18 +0000 (+0100) Subject: kbproto unentanglement: XkbSI_AutoRepeat X-Git-Tag: xkbcommon-0.2.0~179 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2eab7efc13c5d089c9761f7a807970cfb7ad3779;p=platform%2Fupstream%2Flibxkbcommon.git kbproto unentanglement: XkbSI_AutoRepeat That was the only interp flag, so just turn it into a straight boolean. Signed-off-by: Daniel Stone --- diff --git a/src/keymap-dump.c b/src/keymap-dump.c index 41adf5b..13d0ebf 100644 --- a/src/keymap-dump.c +++ b/src/keymap-dump.c @@ -543,7 +543,7 @@ write_compat(struct xkb_keymap *keymap, struct buf *buf) if (interp->match & MATCH_LEVEL_ONE_ONLY) write_buf(buf, "\t\t\tuseModMapMods=level1;\n"); - if (interp->flags & XkbSI_AutoRepeat) + if (interp->repeat) write_buf(buf, "\t\t\trepeat= True;\n"); write_action(keymap, buf, &interp->act, "\t\t\taction= ", ";\n"); diff --git a/src/xkb-priv.h b/src/xkb-priv.h index 7a69356..d43e43e 100644 --- a/src/xkb-priv.h +++ b/src/xkb-priv.h @@ -292,7 +292,7 @@ struct xkb_key_type { struct xkb_sym_interpret { xkb_keysym_t sym; - unsigned char flags; + bool repeat; enum xkb_match_operation match; uint8_t mods; xkb_mod_index_t virtual_mod; diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c index cab6b33..f7b7404 100644 --- a/src/xkbcomp/compat.c +++ b/src/xkbcomp/compat.c @@ -237,7 +237,7 @@ InitCompatInfo(CompatInfo *info, struct xkb_keymap *keymap, unsigned file_id, info->dflt.file_id = file_id; info->dflt.defined = 0; info->dflt.merge = MERGE_OVERRIDE; - info->dflt.interp.flags = 0; + info->dflt.interp.repeat = false; info->dflt.interp.virtual_mod = XKB_MOD_INVALID; memset(&info->dflt.interp.act, 0, sizeof(info->dflt.interp.act)); info->dflt.interp.act.type = ACTION_TYPE_NONE; @@ -255,7 +255,7 @@ ClearCompatInfo(CompatInfo *info) info->name = NULL; info->dflt.defined = 0; info->dflt.merge = MERGE_AUGMENT; - info->dflt.interp.flags = 0; + info->dflt.interp.repeat = false; info->dflt.interp.virtual_mod = XKB_MOD_INVALID; memset(&info->dflt.interp.act, 0, sizeof(info->dflt.interp.act)); info->dflt.interp.act.type = ACTION_TYPE_NONE; @@ -333,8 +333,7 @@ AddInterp(CompatInfo *info, SymInterpInfo *new) } if (UseNewInterpField(SI_FIELD_AUTO_REPEAT, old, new, report, &collide)) { - old->interp.flags &= ~XkbSI_AutoRepeat; - old->interp.flags |= (new->interp.flags & XkbSI_AutoRepeat); + old->interp.repeat = new->interp.repeat; old->defined |= SI_FIELD_AUTO_REPEAT; } if (UseNewInterpField(SI_FIELD_LEVEL_ONE_ONLY, old, new, report, @@ -596,10 +595,7 @@ SetInterpField(CompatInfo *info, SymInterpInfo *si, const char *field, if (!ExprResolveBoolean(keymap->ctx, value, &set)) return ReportSIBadType(info, si, field, "boolean"); - if (set) - si->interp.flags |= XkbSI_AutoRepeat; - else - si->interp.flags &= ~XkbSI_AutoRepeat; + si->interp.repeat = set; si->defined |= SI_FIELD_AUTO_REPEAT; } diff --git a/src/xkbcomp/keymap.c b/src/xkbcomp/keymap.c index 4bad351..b917d79 100644 --- a/src/xkbcomp/keymap.c +++ b/src/xkbcomp/keymap.c @@ -154,7 +154,7 @@ ApplyInterpsToKey(struct xkb_keymap *keymap, struct xkb_key *key) /* Infer default key behaviours from the base level. */ if (group == 0 && level == 0) { if (!(key->explicit & XkbExplicitAutoRepeatMask) && - (!interp || (interp->flags & XkbSI_AutoRepeat))) + (!interp || interp->repeat)) key->repeats = true; }