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
//! Integration with the XKB ecosystem.
//!
//! This module provides integration with the XKB ecosystem, including
//!
//! - loading keymaps from buffers,
//! - loading keymaps from RMLVO names,
//! - loading keymaps from X11 connections,
//! - loading the RMLVO registry,
//! - loading XCompose files.
//!
//! # Example
//!
//! ```
//! # use kbvm::xkb::Context;
//! # use kbvm::xkb::diagnostic::WriteToLog;
//! const MAP: &str = r#"
//! xkb_keymap {
//! // This empty map is not very useful. Under wayland, you would get
//! // this map from the wl_keyboard.keymap event.
//! };
//! "#;
//! let context = Context::default();
//! let keymap = context.keymap_from_bytes(WriteToLog, None, MAP).unwrap();
//! let builder = keymap.to_builder();
//! let _state_machine = builder.build_state_machine();
//! let _lookup_table = builder.build_lookup_table();
//! ```
//!
//! # Features
//!
//! The following features are disabled by default:
//!
//! - `registry` - Provides access to the RMLVO registry. Most applications have no need
//! for this.
//! - `compose` - Allows loading XCompose files.
//! - `x11` - Allows loading keymaps from X11 connections.
//!
//! # Logging
//!
//! This crate does not write to STDERR and does not use the `log` crate. Instead,
//! diagnostic messages are handled via the
//! [`DiagnosticHandler`](diagnostic::DiagnosticHandler) trait that is accepted by
//! functions that might produce diagnostic messages. This allows you to display these
//! messages as you see fit.
//!
//! To keep simple things simple, this crate provides the
//! [`WriteToStderr`](diagnostic::WriteToStderr) and
//! [`WriteToLog`](diagnostic::WriteToLog) implementations that do the obvious things.
//!
//! The `WriteToLog` type depends on the `log` crate and the feature of the same name,
//! which is enabled by default.
pub use ;
pub
pub
pub