xkb: move XkbConvertGetByNameComponents and make it static

This function has only one caller in xkb.c, so no need to keep it exported,
can be moved over into xkb.c and made static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1729>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-10-18 12:45:55 +02:00 committed by Marge Bot
parent cd52a8f8a4
commit 114c1c84b1
3 changed files with 39 additions and 47 deletions

View File

@ -86,14 +86,6 @@ 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 */ ,

View File

@ -5906,6 +5906,45 @@ 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)

View File

@ -390,42 +390,3 @@ 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;
}