libxkbcomp: Add non-xkbfile XkbActionTypeText
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
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 */