From 6a578de9cbac1645633b424630594bd90c53f27e Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Fri, 27 Mar 2009 20:20:01 -0700 Subject: [PATCH] libxkbcomp: Add non-xkbfile XkbActionTypeText --- src/xkbcomp/misc.c | 24 ++++++++++++++++++++++++ src/xkbcomp/misc.h | 3 +++ 2 files changed, 27 insertions(+) diff --git a/src/xkbcomp/misc.c b/src/xkbcomp/misc.c index 750359c..b26c9fa 100644 --- a/src/xkbcomp/misc.c +++ b/src/xkbcomp/misc.c @@ -604,3 +604,27 @@ XkbConfigText(unsigned config, unsigned format) return "unknown"; } } + +static char *actionTypeNames[XkbSA_NumActions]= { + "NoAction", + "SetMods", "LatchMods", "LockMods", + "SetGroup", "LatchGroup", "LockGroup", + "MovePtr", + "PtrBtn", "LockPtrBtn", + "SetPtrDflt", + "ISOLock", + "Terminate", "SwitchScreen", + "SetControls", "LockControls", + "ActionMessage", + "RedirectKey", + "DeviceBtn", "LockDeviceBtn" +}; + +char * +XkbActionTypeText(unsigned type, unsigned format) +{ + + if (type <= XkbSA_LastAction) + return actionTypeNames[type]; + return "Private"; +} diff --git a/src/xkbcomp/misc.h b/src/xkbcomp/misc.h index 49de73b..240233f 100644 --- a/src/xkbcomp/misc.h +++ b/src/xkbcomp/misc.h @@ -111,4 +111,7 @@ extern Bool FindKeyNameForAlias(XkbcDescPtr /* xkb */ , extern char * XkbConfigText(unsigned config, unsigned format); +extern char * +XkbActionTypeText(unsigned type, unsigned format); + #endif /* MISC_H */