2 Copyright 1985, 1987, 1990, 1998 The Open Group
3 Copyright 2008 Dan Nicholson
5 Permission is hereby granted, free of charge, to any person obtaining a
6 copy of this software and associated documentation files (the "Software"),
7 to deal in the Software without restriction, including without limitation
8 the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 and/or sell copies of the Software, and to permit persons to whom the
10 Software is furnished to do so, subject to the following conditions:
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 Except as contained in this notice, the names of the authors or their
23 institutions shall not be used in advertising or otherwise to promote the
24 sale, use or other dealings in this Software without prior written
25 authorization from the authors.
28 /************************************************************
29 Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
31 Permission to use, copy, modify, and distribute this
32 software and its documentation for any purpose and without
33 fee is hereby granted, provided that the above copyright
34 notice appear in all copies and that both that copyright
35 notice and this permission notice appear in supporting
36 documentation, and that the name of Silicon Graphics not be
37 used in advertising or publicity pertaining to distribution
38 of the software without specific prior written permission.
39 Silicon Graphics makes no representation about the suitability
40 of this software for any purpose. It is provided "as is"
41 without any express or implied warranty.
43 SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
44 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
45 AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
46 GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
47 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
48 DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
49 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
50 THE USE OR PERFORMANCE OF THIS SOFTWARE.
52 ********************************************************/
60 #include <X11/Xfuncproto.h>
61 #include <X11/extensions/XKB.h>
63 typedef uint8_t xkb_keycode_t;
65 #define XKB_KEYCODE_MAX 255
66 #define xkb_keycode_is_legal_ext(kc) (kc <= XKB_KEYCODE_MAX)
67 #define xkb_keycode_is_legal_x11(kc) (kc <= XKB_KEYCODE_MAX)
68 #define xkb_keymap_keycode_range_is_legal(xkb) \
69 (xkb->max_key_code > 0 && \
70 xkb->max_key_code > xkb->min_key_code && \
71 xkb_keycode_is_legal_ext(xkb->min_key_code) && \
72 xkb_keycode_is_legal_ext(xkb->max_key_code))
74 /* Duplicate the modifier mask defines so libxkcommon can be used
76 #define XKB_COMMON_SHIFT_MASK (1<<0)
77 #define XKB_COMMON_LOCK_MASK (1<<1)
78 #define XKB_COMMON_CONTROL_MASK (1<<2)
79 #define XKB_COMMON_MOD1_MASK (1<<3)
80 #define XKB_COMMON_MOD2_MASK (1<<4)
81 #define XKB_COMMON_MOD3_MASK (1<<5)
82 #define XKB_COMMON_MOD4_MASK (1<<6)
83 #define XKB_COMMON_MOD5_MASK (1<<7)
86 struct xkb_rule_names {
94 struct xkb_any_action {
99 struct xkb_mod_action {
107 struct xkb_group_action {
113 struct xkb_iso_action {
123 struct xkb_controls_action {
129 struct xkb_device_button_action {
137 struct xkb_device_valuator_action {
148 struct xkb_pointer_default_action {
155 struct xkb_switch_screen_action {
161 struct xkb_redirect_key_action {
163 xkb_keycode_t new_key;
170 struct xkb_pointer_action {
177 struct xkb_message_action {
183 struct xkb_pointer_button_action {
191 struct xkb_any_action any;
192 struct xkb_mod_action mods;
193 struct xkb_group_action group;
194 struct xkb_iso_action iso;
195 struct xkb_controls_action ctrls;
196 struct xkb_device_button_action devbtn;
197 struct xkb_device_valuator_action devval;
198 struct xkb_pointer_default_action dflt;
199 struct xkb_switch_screen_action screen;
200 struct xkb_redirect_key_action redirect; /* XXX wholly unnecessary? */
201 struct xkb_pointer_action ptr; /* XXX delete for DeviceValuator */
202 struct xkb_pointer_button_action btn; /* XXX delete for DeviceBtn */
203 struct xkb_message_action msg; /* XXX just delete */
208 uint32_t mask; /* effective mods */
213 struct xkb_kt_map_entry {
216 struct xkb_mods mods;
219 struct xkb_key_type {
220 struct xkb_mods mods;
222 unsigned char map_count;
223 struct xkb_kt_map_entry * map;
224 struct xkb_mods * preserve;
226 uint32_t *level_names;
229 struct xkb_sym_interpret {
233 uint8_t mods; /* XXX real or virt? */
234 uint32_t virtual_mod;
235 struct xkb_any_action act;
238 struct xkb_compat_map {
239 struct xkb_sym_interpret * sym_interpret;
240 struct xkb_mods groups[XkbNumKbdGroups];
241 unsigned short num_si;
242 unsigned short size_si;
246 unsigned char kt_index[XkbNumKbdGroups];
247 unsigned char group_info;
249 unsigned short offset;
252 #define XkbNumGroups(g) ((g)&0x0f)
253 #define XkbOutOfRangeGroupInfo(g) ((g)&0xf0)
254 #define XkbOutOfRangeGroupAction(g) ((g)&0xc0)
255 #define XkbOutOfRangeGroupNumber(g) (((g)&0x30)>>4)
256 #define XkbSetGroupInfo(g,w,n) (((w)&0xc0)|(((n)&3)<<4)|((g)&0x0f))
257 #define XkbSetNumGroups(g,n) (((g)&0xf0)|((n)&0x0f))
259 struct xkb_client_map {
260 unsigned char size_types;
261 unsigned char num_types;
262 struct xkb_key_type * types;
267 struct xkb_sym_map * key_sym_map;
269 unsigned char *modmap;
272 #define XkbCMKeyGroupInfo(m,k) ((m)->key_sym_map[k].group_info)
273 #define XkbCMKeyNumGroups(m,k) (XkbNumGroups((m)->key_sym_map[k].group_info))
274 #define XkbCMKeyGroupWidth(m,k,g) (XkbCMKeyType(m,k,g)->num_levels)
275 #define XkbCMKeyGroupsWidth(m,k) ((m)->key_sym_map[k].width)
276 #define XkbCMKeyTypeIndex(m,k,g) ((m)->key_sym_map[k].kt_index[g&0x3])
277 #define XkbCMKeyType(m,k,g) (&(m)->types[XkbCMKeyTypeIndex(m,k,g)])
278 #define XkbCMKeyNumSyms(m,k) (XkbCMKeyGroupsWidth(m,k)*XkbCMKeyNumGroups(m,k))
279 #define XkbCMKeySymsOffset(m,k) ((m)->key_sym_map[k].offset)
280 #define XkbCMKeySymsPtr(m,k) (&(m)->syms[XkbCMKeySymsOffset(m,k)])
282 struct xkb_behavior {
287 struct xkb_server_map {
288 unsigned short num_acts;
289 unsigned short size_acts;
291 #if defined(__cplusplus) || defined(c_plusplus)
292 /* explicit is a C++ reserved word */
293 unsigned char * c_explicit;
295 unsigned char * explicit;
298 union xkb_action *acts;
299 struct xkb_behavior *behaviors;
300 unsigned short *key_acts;
301 unsigned char *explicits;
302 uint32_t vmods[XkbNumVirtualMods];
306 #define XkbSMKeyActionsPtr(m,k) (&(m)->acts[(m)->key_acts[k]])
308 struct xkb_indicator_map {
310 unsigned char which_groups;
311 unsigned char groups;
312 unsigned char which_mods;
313 struct xkb_mods mods;
317 struct xkb_indicator {
318 unsigned long phys_indicators;
319 struct xkb_indicator_map maps[XkbNumIndicators];
322 struct xkb_key_name {
323 char name[XkbKeyNameLength];
326 struct xkb_key_alias {
327 char real[XkbKeyNameLength];
328 char alias[XkbKeyNameLength];
337 uint32_t vmods[XkbNumVirtualMods];
338 uint32_t indicators[XkbNumIndicators];
339 uint32_t groups[XkbNumKbdGroups];
340 struct xkb_key_name * keys;
341 struct xkb_key_alias * key_aliases;
342 uint32_t *radio_groups;
343 uint32_t phys_symbols;
345 xkb_keycode_t num_keys;
346 xkb_keycode_t num_key_aliases;
347 unsigned short num_rg;
350 struct xkb_property {
371 unsigned short num_points;
372 unsigned short sz_points;
373 unsigned short corner_radius;
374 struct xkb_point * points;
379 unsigned short num_outlines;
380 unsigned short sz_outlines;
381 struct xkb_outline * outlines;
382 struct xkb_outline * approx;
383 struct xkb_outline * primary;
384 struct xkb_bounds bounds;
387 struct xkb_shape_doodad {
390 unsigned char priority;
394 unsigned short color_ndx;
395 unsigned short shape_ndx;
397 #define XkbShapeDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
398 #define XkbShapeDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
399 #define XkbSetShapeDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
400 #define XkbSetShapeDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])
402 struct xkb_text_doodad {
405 unsigned char priority;
411 unsigned short color_ndx;
415 #define XkbTextDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
416 #define XkbSetTextDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
418 struct xkb_indicator_doodad {
421 unsigned char priority;
425 unsigned short shape_ndx;
426 unsigned short on_color_ndx;
427 unsigned short off_color_ndx;
429 #define XkbIndicatorDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
430 #define XkbIndicatorDoodadOnColor(g,d) (&(g)->colors[(d)->on_color_ndx])
431 #define XkbIndicatorDoodadOffColor(g,d) (&(g)->colors[(d)->off_color_ndx])
432 #define XkbSetIndicatorDoodadOnColor(g,d,c) \
433 ((d)->on_color_ndx= (c)-&(g)->colors[0])
434 #define XkbSetIndicatorDoodadOffColor(g,d,c) \
435 ((d)->off_color_ndx= (c)-&(g)->colors[0])
436 #define XkbSetIndicatorDoodadShape(g,d,s) \
437 ((d)->shape_ndx= (s)-&(g)->shapes[0])
439 struct xkb_logo_doodad {
442 unsigned char priority;
446 unsigned short color_ndx;
447 unsigned short shape_ndx;
450 #define XkbLogoDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
451 #define XkbLogoDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
452 #define XkbSetLogoDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
453 #define XkbSetLogoDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])
455 struct xkb_any_doodad {
458 unsigned char priority;
465 struct xkb_any_doodad any;
466 struct xkb_shape_doodad shape;
467 struct xkb_text_doodad text;
468 struct xkb_indicator_doodad indicator;
469 struct xkb_logo_doodad logo;
472 #define XkbUnknownDoodad 0
473 #define XkbOutlineDoodad 1
474 #define XkbSolidDoodad 2
475 #define XkbTextDoodad 3
476 #define XkbIndicatorDoodad 4
477 #define XkbLogoDoodad 5
480 struct xkb_key_name name;
482 unsigned char shape_ndx;
483 unsigned char color_ndx;
485 #define XkbKeyShape(g,k) (&(g)->shapes[(k)->shape_ndx])
486 #define XkbKeyColor(g,k) (&(g)->colors[(k)->color_ndx])
487 #define XkbSetKeyShape(g,k,s) ((k)->shape_ndx= (s)-&(g)->shapes[0])
488 #define XkbSetKeyColor(g,k,c) ((k)->color_ndx= (c)-&(g)->colors[0])
493 unsigned short num_keys;
494 unsigned short sz_keys;
496 struct xkb_key * keys;
497 struct xkb_bounds bounds;
502 unsigned char priority;
505 unsigned short width;
506 unsigned short height;
508 unsigned short num_rows;
509 unsigned short num_doodads;
510 unsigned short num_overlays;
511 unsigned short sz_rows;
512 unsigned short sz_doodads;
513 unsigned short sz_overlays;
514 struct xkb_row * rows;
515 union xkb_doodad * doodads;
516 struct xkb_bounds bounds;
517 struct xkb_overlay *overlays;
520 struct xkb_overlay_key {
521 struct xkb_key_name over;
522 struct xkb_key_name under;
525 struct xkb_overlay_row {
526 unsigned short row_under;
527 unsigned short num_keys;
528 unsigned short sz_keys;
529 struct xkb_overlay_key * keys;
534 struct xkb_section * section_under;
535 unsigned short num_rows;
536 unsigned short sz_rows;
537 struct xkb_overlay_row * rows;
538 struct xkb_bounds * bounds;
541 struct xkb_geometry {
543 unsigned short width_mm;
544 unsigned short height_mm;
546 struct xkb_color * label_color;
547 struct xkb_color * base_color;
548 unsigned short sz_properties;
549 unsigned short sz_colors;
550 unsigned short sz_shapes;
551 unsigned short sz_sections;
552 unsigned short sz_doodads;
553 unsigned short sz_key_aliases;
554 unsigned short num_properties;
555 unsigned short num_colors;
556 unsigned short num_shapes;
557 unsigned short num_sections;
558 unsigned short num_doodads;
559 unsigned short num_key_aliases;
560 struct xkb_property * properties;
561 struct xkb_color * colors;
562 struct xkb_shape * shapes;
563 struct xkb_section * sections;
564 union xkb_doodad * doodads;
565 struct xkb_key_alias * key_aliases;
567 #define XkbGeomColorIndex(g,c) ((int)((c)-&(g)->colors[0]))
569 #define XkbGeomPropertiesMask (1<<0)
570 #define XkbGeomColorsMask (1<<1)
571 #define XkbGeomShapesMask (1<<2)
572 #define XkbGeomSectionsMask (1<<3)
573 #define XkbGeomDoodadsMask (1<<4)
574 #define XkbGeomKeyAliasesMask (1<<5)
575 #define XkbGeomAllMask (0x3f)
577 struct xkb_geometry_sizes {
579 unsigned short num_properties;
580 unsigned short num_colors;
581 unsigned short num_shapes;
582 unsigned short num_sections;
583 unsigned short num_doodads;
584 unsigned short num_key_aliases;
587 struct xkb_controls {
588 unsigned char mk_dflt_btn;
589 unsigned char num_groups;
590 unsigned char groups_wrap;
591 struct xkb_mods internal;
592 struct xkb_mods ignore_lock;
593 unsigned int enabled_ctrls;
594 unsigned short repeat_delay;
595 unsigned short repeat_interval;
596 unsigned short slow_keys_delay;
597 unsigned short debounce_delay;
598 unsigned short mk_delay;
599 unsigned short mk_interval;
600 unsigned short mk_time_to_max;
601 unsigned short mk_max_speed;
603 unsigned short ax_options;
604 unsigned short ax_timeout;
605 unsigned short axt_opts_mask;
606 unsigned short axt_opts_values;
607 unsigned int axt_ctrls_mask;
608 unsigned int axt_ctrls_values;
609 unsigned char *per_key_repeat;
612 /* Common keyboard description structure */
614 unsigned int defined;
615 unsigned short flags;
616 unsigned short device_spec;
617 xkb_keycode_t min_key_code;
618 xkb_keycode_t max_key_code;
620 struct xkb_controls * ctrls;
621 struct xkb_server_map * server;
622 struct xkb_client_map * map;
623 struct xkb_indicator * indicators;
624 struct xkb_names * names;
625 struct xkb_compat_map * compat;
626 struct xkb_geometry * geom;
629 #define XkbKeyKeyTypeIndex(d,k,g) (XkbCMKeyTypeIndex((d)->map,k,g))
630 #define XkbKeyKeyType(d,k,g) (XkbCMKeyType((d)->map,k,g))
631 #define XkbKeyGroupWidth(d,k,g) (XkbCMKeyGroupWidth((d)->map,k,g))
632 #define XkbKeyGroupsWidth(d,k) (XkbCMKeyGroupsWidth((d)->map,k))
633 #define XkbKeyGroupInfo(d,k) (XkbCMKeyGroupInfo((d)->map,(k)))
634 #define XkbKeyNumGroups(d,k) (XkbCMKeyNumGroups((d)->map,(k)))
635 #define XkbKeyNumSyms(d,k) (XkbCMKeyNumSyms((d)->map,(k)))
636 #define XkbKeySymsPtr(d,k) (XkbCMKeySymsPtr((d)->map,(k)))
637 #define XkbKeySym(d,k,n) (XkbKeySymsPtr(d,k)[n])
638 #define XkbKeySymEntry(d,k,sl,g) \
639 (XkbKeySym(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))))
640 #define XkbKeyAction(d,k,n) \
641 (XkbKeyHasActions(d,k)?&XkbKeyActionsPtr(d,k)[n]:NULL)
642 #define XkbKeyActionEntry(d,k,sl,g) \
643 (XkbKeyHasActions(d,k)?\
644 XkbKeyAction(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))):NULL)
646 #define XkbKeyHasActions(d,k) ((d)->server->key_acts[k]!=0)
647 #define XkbKeyNumActions(d,k) (XkbKeyHasActions(d,k)?XkbKeyNumSyms(d,k):1)
648 #define XkbKeyActionsPtr(d,k) (XkbSMKeyActionsPtr((d)->server,k))
649 #define XkbKeycodeInRange(d,k) (((k)>=(d)->min_key_code)&&\
650 ((k)<=(d)->max_key_code))
651 #define XkbNumKeys(d) ((d)->max_key_code-(d)->min_key_code+1)
653 struct xkb_map_changes {
654 unsigned short changed;
655 xkb_keycode_t min_key_code;
656 xkb_keycode_t max_key_code;
657 unsigned char first_type;
658 unsigned char num_types;
659 xkb_keycode_t first_key_sym;
660 xkb_keycode_t num_key_syms;
661 xkb_keycode_t first_key_act;
662 xkb_keycode_t num_key_acts;
663 xkb_keycode_t first_key_behavior;
664 xkb_keycode_t num_key_behaviors;
665 xkb_keycode_t first_key_explicit;
666 xkb_keycode_t num_key_explicit;
667 xkb_keycode_t first_modmap_key;
668 xkb_keycode_t num_modmap_keys;
669 xkb_keycode_t first_vmodmap_key;
670 xkb_keycode_t num_vmodmap_keys;
671 unsigned short vmods;
674 struct xkb_controls_changes {
675 unsigned int changed_ctrls;
676 unsigned int enabled_ctrls_changes;
677 int num_groups_changed;
680 struct xkb_indicator_changes {
681 unsigned int state_changes;
682 unsigned int map_changes;
685 struct xkb_name_changes {
686 unsigned int changed;
687 unsigned char first_type;
688 unsigned char num_types;
689 unsigned char first_lvl;
690 unsigned char num_lvls;
691 xkb_keycode_t num_aliases;
692 unsigned char num_rg;
693 xkb_keycode_t first_key;
694 xkb_keycode_t num_keys;
695 unsigned short changed_vmods;
696 unsigned long changed_indicators;
697 unsigned char changed_groups;
700 struct xkb_compat_changes {
701 unsigned char changed_groups;
702 unsigned short first_si;
703 unsigned short num_si;
707 unsigned short device_spec;
708 unsigned short state_changes;
709 struct xkb_map_changes map;
710 struct xkb_controls_changes ctrls;
711 struct xkb_indicator_changes indicators;
712 struct xkb_name_changes names;
713 struct xkb_compat_changes compat;
716 struct xkb_component_names {
725 struct xkb_component_name {
726 unsigned short flags;
730 struct xkb_component_list {
737 struct xkb_component_name * keymaps;
738 struct xkb_component_name * keycodes;
739 struct xkb_component_name * types;
740 struct xkb_component_name * compat;
741 struct xkb_component_name * symbols;
742 struct xkb_component_name * geometry;
746 unsigned char group; /* base + latched + locked */
747 /* FIXME: Why are base + latched short and not char?? */
748 unsigned short base_group; /* physically ... down? */
749 unsigned short latched_group;
750 unsigned char locked_group;
752 unsigned char mods; /* base + latched + locked */
753 unsigned char base_mods; /* physically down */
754 unsigned char latched_mods;
755 unsigned char locked_mods;
757 unsigned char compat_state; /* mods + group for core state */
759 /* grab mods = all depressed and latched mods, _not_ locked mods */
760 unsigned char grab_mods; /* grab mods minus internal mods */
761 unsigned char compat_grab_mods; /* grab mods + group for core state,
762 but not locked groups if
763 IgnoreGroupLocks set */
765 /* effective mods = all mods (depressed, latched, locked) */
766 unsigned char lookup_mods; /* effective mods minus internal mods */
767 unsigned char compat_lookup_mods; /* effective mods + group */
769 unsigned short ptr_buttons; /* core pointer buttons */
772 #define XkbStateFieldFromRec(s) XkbBuildCoreState((s)->lookup_mods,(s)->group)
773 #define XkbGrabStateFromRec(s) XkbBuildCoreState((s)->grab_mods,(s)->group)
775 #define XkbNumGroups(g) ((g)&0x0f)
776 #define XkbOutOfRangeGroupInfo(g) ((g)&0xf0)
777 #define XkbOutOfRangeGroupAction(g) ((g)&0xc0)
778 #define XkbOutOfRangeGroupNumber(g) (((g)&0x30)>>4)
779 #define XkbSetNumGroups(g,n) (((g)&0xf0)|((n)&0x0f))
783 typedef uint32_t (*InternAtomFuncPtr)(const char *val);
784 typedef const char *(*GetAtomValueFuncPtr)(uint32_t atom);
786 _X_EXPORT extern void
787 xkb_init_atoms(InternAtomFuncPtr intern, GetAtomValueFuncPtr get_atom_value);
789 _X_EXPORT extern uint32_t
790 xkb_intern_atom(const char *name);
792 _X_EXPORT extern struct xkb_desc *
793 xkb_compile_keymap_from_rules(const struct xkb_rule_names *rules);
795 _X_EXPORT extern struct xkb_desc *
796 xkb_compile_keymap_from_components(const struct xkb_component_names * ktcsg);
798 _X_EXPORT extern struct xkb_desc *
799 xkb_compile_keymap_from_file(FILE *inputFile, const char *mapName);
801 _X_EXPORT extern struct xkb_desc *
802 xkb_compile_keymap_from_string(const char *string, const char *mapName);
804 _X_EXPORT extern void
805 xkb_free_keymap(struct xkb_desc *xkb);
807 _X_EXPORT extern struct xkb_component_list *
808 xkb_list_components(struct xkb_component_names * ptrns, int *maxMatch);
811 * Canonicalises component names by prepending the relevant component from
812 * 'old' to the one in 'names' when the latter has a leading '+' or '|', and
813 * by replacing a '%' with the relevant component, e.g.:
816 * ------------------------------------------
819 * foo+%|baz bar foo+bar|baz
821 * If a component in names needs to be modified, the existing value will be
822 * free()d, and a new one allocated with malloc().
824 _X_EXPORT extern void
825 xkb_canonicalise_components(struct xkb_component_names * names,
826 const struct xkb_component_names * old);
829 * Converts a keysym to a string; will return unknown Unicode codepoints
830 * as "Ua1b2", and other unknown keysyms as "0xabcd1234".
832 * This is uint32_t rather than KeySym, as KeySym changes size between
833 * client and server (no, really).
835 _X_EXPORT extern void
836 xkb_keysym_to_string(uint32_t ks, char *buffer, size_t size);
839 * See xkb_keysym_to_string comments: this function will accept any string
840 * from that function.
842 _X_EXPORT extern uint32_t
843 xkb_string_to_keysym(const char *s);
847 #endif /* _XKBCOMMON_H_ */