diff --git a/include/xkbfile.h b/include/xkbfile.h index 706f94018..df2221313 100644 --- a/include/xkbfile.h +++ b/include/xkbfile.h @@ -86,6 +86,14 @@ extern _X_EXPORT int XkbFindKeycodeByName(XkbDescPtr /* xkb */ , Bool /* use_aliases */ ); +/***====================================================================***/ + +extern _X_EXPORT unsigned XkbConvertGetByNameComponents(Bool /* toXkm */ , + unsigned /* orig */ + ); + +/***====================================================================***/ + extern _X_EXPORT Bool XkbWriteXKBKeycodes(FILE * /* file */ , XkbDescPtr /* result */ , Bool /* topLevel */ , diff --git a/xkb/xkb.c b/xkb/xkb.c index 313309155..2433b7d73 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -5906,45 +5906,6 @@ ProcXkbListComponents(ClientPtr client) return Success; } -static unsigned -XkbConvertGetByNameComponents(Bool toXkm, unsigned orig) -{ - unsigned rtrn; - - rtrn = 0; - if (toXkm) { - if (orig & XkbGBN_TypesMask) - rtrn |= XkmTypesMask; - if (orig & XkbGBN_CompatMapMask) - rtrn |= XkmCompatMapMask; - if (orig & XkbGBN_SymbolsMask) - rtrn |= XkmSymbolsMask; - if (orig & XkbGBN_IndicatorMapMask) - rtrn |= XkmIndicatorsMask; - if (orig & XkbGBN_KeyNamesMask) - rtrn |= XkmKeyNamesMask; - if (orig & XkbGBN_GeometryMask) - rtrn |= XkmGeometryMask; - } - else { - if (orig & XkmTypesMask) - rtrn |= XkbGBN_TypesMask; - if (orig & XkmCompatMapMask) - rtrn |= XkbGBN_CompatMapMask; - if (orig & XkmSymbolsMask) - rtrn |= XkbGBN_SymbolsMask; - if (orig & XkmIndicatorsMask) - rtrn |= XkbGBN_IndicatorMapMask; - if (orig & XkmKeyNamesMask) - rtrn |= XkbGBN_KeyNamesMask; - if (orig & XkmGeometryMask) - rtrn |= XkbGBN_GeometryMask; - if (orig != 0) - rtrn |= XkbGBN_OtherNamesMask; - } - return rtrn; -} - /***====================================================================***/ int ProcXkbGetKbdByName(ClientPtr client) diff --git a/xkb/xkbfmisc.c b/xkb/xkbfmisc.c index a2063e40f..146e36683 100644 --- a/xkb/xkbfmisc.c +++ b/xkb/xkbfmisc.c @@ -390,3 +390,42 @@ XkbFindKeycodeByName(XkbDescPtr xkb, char *name, Bool use_aliases) } return 0; } + +unsigned +XkbConvertGetByNameComponents(Bool toXkm, unsigned orig) +{ + unsigned rtrn; + + rtrn = 0; + if (toXkm) { + if (orig & XkbGBN_TypesMask) + rtrn |= XkmTypesMask; + if (orig & XkbGBN_CompatMapMask) + rtrn |= XkmCompatMapMask; + if (orig & XkbGBN_SymbolsMask) + rtrn |= XkmSymbolsMask; + if (orig & XkbGBN_IndicatorMapMask) + rtrn |= XkmIndicatorsMask; + if (orig & XkbGBN_KeyNamesMask) + rtrn |= XkmKeyNamesMask; + if (orig & XkbGBN_GeometryMask) + rtrn |= XkmGeometryMask; + } + else { + if (orig & XkmTypesMask) + rtrn |= XkbGBN_TypesMask; + if (orig & XkmCompatMapMask) + rtrn |= XkbGBN_CompatMapMask; + if (orig & XkmSymbolsMask) + rtrn |= XkbGBN_SymbolsMask; + if (orig & XkmIndicatorsMask) + rtrn |= XkbGBN_IndicatorMapMask; + if (orig & XkmKeyNamesMask) + rtrn |= XkbGBN_KeyNamesMask; + if (orig & XkmGeometryMask) + rtrn |= XkbGBN_GeometryMask; + if (orig != 0) + rtrn |= XkbGBN_OtherNamesMask; + } + return rtrn; +}