Documentation
¶
Overview ¶
Package registry lists the models, layouts, variants and options a ruleset offers, from xkeyboard-config's XML files, the way libxkbregistry does. It lives apart from package xkb so that compositors and clients do not link an XML parser for a configuration interface's needs.
Index ¶
- Variables
- type Context
- func (c *Context) AppendDefaultIncludePaths() bool
- func (c *Context) AppendIncludePath(path string) bool
- func (c *Context) Layouts() []Layout
- func (c *Context) LogLevel() xkb.LogLevel
- func (c *Context) Models() []Model
- func (c *Context) OptionGroups() []OptionGroup
- func (c *Context) Parse(ruleset string) error
- func (c *Context) ParseDefaultRuleset() error
- func (c *Context) SetLogFunc(fn xkb.LogFunc)
- func (c *Context) SetLogLevel(level xkb.LogLevel)
- func (c *Context) SetUserData(v any)
- func (c *Context) UserData() any
- type Flags
- type Layout
- type Model
- type Option
- type OptionGroup
- type Popularity
Constants ¶
This section is empty.
Variables ¶
var ErrNoIncludes = errors.New("registry: no valid include path")
ErrNoIncludes reports a context none of whose default include paths exists.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context reads rulesets. Parse fills it once.
func NewContext ¶
NewContext makes a context. RXKB_LOG_LEVEL sets its log level.
func (*Context) AppendDefaultIncludePaths ¶
AppendDefaultIncludePaths adds the default search path, false once parsed or when none of it exists.
func (*Context) AppendIncludePath ¶
AppendIncludePath adds a directory to the search path, false once parsed or when it is not a readable directory.
func (*Context) OptionGroups ¶
func (c *Context) OptionGroups() []OptionGroup
OptionGroups is every option group, in the order first read.
func (*Context) Parse ¶
Parse reads a ruleset's files from every include path, earlier paths winning, and may be called once.
func (*Context) ParseDefaultRuleset ¶
ParseDefaultRuleset is Parse of the evdev ruleset.
func (*Context) SetLogFunc ¶
SetLogFunc routes log messages to fn; nil restores the default, stderr.
func (*Context) SetLogLevel ¶
SetLogLevel sets the least severe level logged.
func (*Context) SetUserData ¶
SetUserData keeps a value on the context.
type Layout ¶
type Layout struct {
Name, Variant, Brief, Description string
Popularity Popularity
ISO639, ISO3166 []string
}
Layout is a layout, or a variant of one when Variant is set.
type Model ¶
type Model struct {
Name, Description, Vendor string
Popularity Popularity
}
Model is a keyboard model.
type Option ¶
type Option struct {
Name, Brief, Description string
Popularity Popularity
LayoutSpecific bool
}
Option is one XKB option.
type OptionGroup ¶
type OptionGroup struct {
Name, Description string
Popularity Popularity
AllowsMultiple bool
Options []Option
// contains filtered or unexported fields
}
OptionGroup is a group of related options.
type Popularity ¶
type Popularity uint8
Popularity is how common an entry is.
const ( // Standard is an entry of the ruleset's main file. Standard Popularity = iota + 1 // Exotic is an entry of the ruleset's extras file, or one marked exotic. Exotic )