Move KcCGST API to internal-only And don't export it. We don't need it for X11 support, let alone anything else. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
diff --git a/include/xkbcommon/xkbcommon.h b/include/xkbcommon/xkbcommon.h
index 70ecb42..d98daf8 100644
--- a/include/xkbcommon/xkbcommon.h
+++ b/include/xkbcommon/xkbcommon.h
@@ -117,19 +117,6 @@ struct xkb_rule_names {
};
/**
- * Legacy names for the components of an XKB keymap, also known as KcCGST.
- * This is only used in deprecated entrypoints which might be removed or
- * shuffled off to a support library.
- */
-struct xkb_component_names {
- char *keymap;
- char *keycodes;
- char *types;
- char *compat;
- char *symbols;
-};
-
-/**
* Opaque context object; may only be created, accessed, manipulated and
* destroyed through the xkb_ctx_*() API.
*/
@@ -152,24 +139,6 @@ extern "C" {
#endif
/*
- * Canonicalises component names by prepending the relevant component from
- * 'old' to the one in 'names' when the latter has a leading '+' or '|', and
- * by replacing a '%' with the relevant component, e.g.:
- *
- * names old output
- * ------------------------------------------
- * +bar foo foo+bar
- * |quux baz baz|quux
- * foo+%|baz bar foo+bar|baz
- *
- * If a component in names needs to be modified, the existing value will be
- * free()d, and a new one allocated with malloc().
- */
-void
-xkb_canonicalise_components(struct xkb_component_names *names,
- const struct xkb_component_names *old);
-
-/*
* Returns the name for a keysym as a string; will return unknown Unicode
* codepoints as "Ua1b2", and other unknown keysyms as "0xabcd1234".
*/
@@ -284,21 +253,6 @@ xkb_map_new_from_names(struct xkb_ctx *ctx,
const struct xkb_rule_names *names,
enum xkb_map_compile_flags flags);
-/**
- * Deprecated entrypoint for legacy users who need to be able to compile
- * XKB keymaps by KcCGST (Keycodes + Compat + Geometry + Symbols + Types)
- * names.
- *
- * You should not use this unless you are the X server. This entrypoint
- * may well disappear in future releases. Please, please, don't use it.
- *
- * Geometry will be ignored since xkbcommon does not support it in any way.
- */
-struct xkb_keymap *
-xkb_map_new_from_kccgst(struct xkb_ctx *ctx,
- const struct xkb_component_names *kccgst,
- enum xkb_map_compile_flags flags);
-
enum xkb_keymap_format {
/** The current/classic XKB text format, as generated by xkbcomp -xkb. */
XKB_KEYMAP_FORMAT_TEXT_V1 = 1,
diff --git a/src/xkb-priv.h b/src/xkb-priv.h
index efeb14c..b76b8c0 100644
--- a/src/xkb-priv.h
+++ b/src/xkb-priv.h
@@ -108,6 +108,17 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define XkmKeymapOptional ((XkmTypesMask|XkmGeometryMask)&(~XkmKeymapRequired))
#define XkmKeymapLegal (XkmKeymapRequired|XkmKeymapOptional)
+/**
+ * Legacy names for the components of an XKB keymap, also known as KcCGST.
+ */
+struct xkb_component_names {
+ char *keymap;
+ char *keycodes;
+ char *types;
+ char *compat;
+ char *symbols;
+};
+
struct xkb_any_action {
uint8_t type;
uint8_t data[7];
@@ -443,6 +454,39 @@ xkb_key_get_syms_by_level(struct xkb_keymap *keymap, xkb_keycode_t key,
unsigned int group, unsigned int level,
const xkb_keysym_t **syms_out);
+/*
+ * Canonicalises component names by prepending the relevant component from
+ * 'old' to the one in 'names' when the latter has a leading '+' or '|', and
+ * by replacing a '%' with the relevant component, e.g.:
+ *
+ * names old output
+ * ------------------------------------------
+ * +bar foo foo+bar
+ * |quux baz baz|quux
+ * foo+%|baz bar foo+bar|baz
+ *
+ * If a component in names needs to be modified, the existing value will be
+ * free()d, and a new one allocated with malloc().
+ */
+void
+xkb_canonicalise_components(struct xkb_component_names *names,
+ const struct xkb_component_names *old);
+
+/**
+ * Deprecated entrypoint for legacy users who need to be able to compile
+ * XKB keymaps by KcCGST (Keycodes + Compat + Geometry + Symbols + Types)
+ * names.
+ *
+ * You should not use this unless you are the X server. This entrypoint
+ * may well disappear in future releases. Please, please, don't use it.
+ *
+ * Geometry will be ignored since xkbcommon does not support it in any way.
+ */
+struct xkb_keymap *
+xkb_map_new_from_kccgst(struct xkb_ctx *ctx,
+ const struct xkb_component_names *kccgst,
+ enum xkb_map_compile_flags flags);
+
extern int
xkb_ctx_take_file_id(struct xkb_ctx *ctx);
diff --git a/test/canonicalise.c b/test/canonicalise.c
index f223363..c437345 100644
--- a/test/canonicalise.c
+++ b/test/canonicalise.c
@@ -29,6 +29,7 @@
#include <stdlib.h>
#include "xkbcommon/xkbcommon.h"
+#include "xkb-priv.h"
struct test_data {
struct xkb_component_names new;
diff --git a/test/namescomp.c b/test/namescomp.c
index d73018c..58a17fc 100644
--- a/test/namescomp.c
+++ b/test/namescomp.c
@@ -29,6 +29,7 @@ authorization from the authors.
#include <stdio.h>
#include <string.h>
+#include "xkb-priv.h"
#include "xkbcommon/xkbcommon.h"
static int